Step One: Installing Rsnapshot and Configuring SSH Keys

Similar documents
Back Up Linux And Windows Systems With BackupPC

Backing Up Your System With rsnapshot

Laboration 3 - Administration

Automated Offsite Backup with rdiff-backup

Extending Remote Desktop for Large Installations. Distributed Package Installs

SSH and FTP on Ubuntu WNYLUG Neal Chapman 09/09/2009

A SHORT INTRODUCTION TO DUPLICITY WITH CLOUD OBJECT STORAGE. Version

CONNECTING TO DEPARTMENT OF COMPUTER SCIENCE SERVERS BOTH FROM ON AND OFF CAMPUS USING TUNNELING, PuTTY, AND VNC Client Utilities

Single Node Hadoop Cluster Setup

IBM WebSphere Application Server Version 7.0

How to Install Multicraft on a VPS or Dedicated Server (Ubuntu bit)

Source Code Management for Continuous Integration and Deployment. Version 1.0 DO NOT DISTRIBUTE

Install and configure SSH server

FileCruiser Backup & Restoring Guide

Remote Access to Unix Machines

How To Backup On Ubuntu (Amd64) With Back In Time (Amd) On Windows Xp) On A Windows Xp (Amd32) On Ubunus On A Ubuntu

JAMF Software Server Installation Guide for Linux. Version 8.6

How To Set Up A Backupassist For An Raspberry Netbook With A Data Host On A Nsync Server On A Usb 2 (Qnap) On A Netbook (Qnet) On An Usb 2 On A Cdnap (

Partek Flow Installation Guide

Creating an ESS instance on the Amazon Cloud

Using Network Attached Storage with Linux. by Andy Pepperdine

Nessus Training Session 2 - Scanning and Reporting

NovaBACKUP xsp Version 15.0 Upgrade Guide

TSM for Windows Installation Instructions: Download the latest TSM Client Using the following link:

How to Backup XenServer VM with VirtualIQ

Adafruit's Raspberry Pi Lesson 7. Remote Control with VNC

Rapid Access Cloud: Se1ng up a Proxy Host

Setup and configuration for Intelicode. SQL Server Express

Linux Development Environment Description Based on VirtualBox Structure

WinSCP PuTTY as an alternative to F-Secure July 11, 2006

Active Directory Authentication Integration

Livezilla How to Install on Shared Hosting By: Jon Manning

Setup a Virtual Host/Website

SERVER HARDENING. Presented by: Daniel Waymel and Corrin Thompson at TexSAW 2014 at the University of Texas at Dallas

Tera Term Telnet. Introduction

Creating a DUO MFA Service in AWS

Centralized Mac Home Directories On Windows Servers: Using Windows To Serve The Mac

INSTALL ZENTYAL SERVER

Ulteo Open Virtual Desktop Installation

FTP Server Configuration

Adafruit's Raspberry Pi Lesson 6. Using SSH

Adobe Marketing Cloud Using FTP and sftp with the Adobe Marketing Cloud

Configuration Guide. Remote Backups How-To Guide. Overview

Installing Hadoop. You need a *nix system (Linux, Mac OS X, ) with a working installation of Java 1.7, either OpenJDK or the Oracle JDK. See, e.g.

Accessing VirtualBox Guests from Host using SSH, WinSCP and Tunnelling

Parallels Cloud Server 6.0

How to backup a remote MySQL server with ZRM over the Internet

Backing Up TestTrack Native Project Databases

White Paper. Installation and Configuration of Fabasoft Folio IMAP Service. Fabasoft Folio 2015 Update Rollup 3

White Paper. Fabasoft on Linux Cluster Support. Fabasoft Folio 2015 Update Rollup 2

MIGRATING TO AVALANCHE 5.0 WITH MS SQL SERVER

Using RADIUS Agent for Transparent User Identification

Managing Software and Configurations

Cloud Homework instructions for AWS default instance (Red Hat based)

How To Install Openstack On Ubuntu (Amd64)

Cassandra Installation over Ubuntu 1. Installing VMware player:

Git Fusion Guide August 2015 Update

CTERA Agent for Linux

SSH and Basic Commands

IIS, FTP Server and Windows

DVS-100 Installation Guide

Device Log Export ENGLISH

Secure Shell. The Protocol

Signiant Agent installation

Configure Backup Server for Cisco Unified Communications Manager

Creating client-server setup with multiple clients

How To Install Netbackup Access Control (Netbackup) On A Netbackups (Net Backup) On Unix And Non Ha (Net Backup) (Net Backups) (Unix) (Non Ha) (Windows) (

Implementing Microsoft SQL Server 2008 Exercise Guide. Database by Design

DESLock+ Basic Setup Guide Version 1.20, rev: June 9th 2014

How To Install Linux, Apache, MySQL, PHP (LAMP) stack on Ubuntu

INASP: Effective Network Management Workshops

User Guide Microsoft Exchange Remote Test Instructions

Management Utilities Configuration for UAC Environments

Installation documentation for Ulteo Open Virtual Desktop

DVS-100 Installation Guide

Setting Up Specify to use a Shared Workstation as a Database Server

BACKUP YOUR SENSITIVE DATA WITH BACKUP- MANAGER

Configuring MailArchiva with Insight Server

Create a virtual machine at your assigned virtual server. Use the following specs

Quick Start Guide. Cerberus FTP is distributed in Canada through C&C Software. Visit us today at

SmartFiler Backup Appliance User Guide 2.0

Getting Started With Delegated Administration

Using Websense Data Endpoint Client Software

2. Boot using the Debian Net Install cd and when prompted to continue type "linux26", this will load the 2.6 kernel

VIPERVAULT STORAGECRAFT SHADOWPROTECT SETUP GUIDE

Plesk Control Panel Adding accounts

Keystone 600N5 SERVER and STAND-ALONE INSTALLATION INSTRUCTIONS

User Guide Online Backup

The objective of this lab is to learn how to set up an environment for running distributed Hadoop applications.

Configuring Color Access on the WorkCentre 7120 Using Microsoft Active Directory Customer Tip

SSH! Keep it secret. Keep it safe

Junio SSL WebLogic Oracle. Guía de Instalación. Junio, SSL WebLogic Oracle Guía de Instalación CONFIDENCIAL Página 1 de 19

HP Device Manager 4.6

Configuring a Windows 2003 Server for IAS

freesshd SFTP Server on Windows

EventTracker Windows syslog User Guide

Clearswift Information Governance

NovaBACKUP. Storage Server. NovaStor / May 2011

Transcription:

Source: https://www.digitalocean.com/community/articles/how-to-installrsnapshot-on-ubuntu-12-04 What the Red Means The lines that the user needs to enter or customize will be in red in this tutorial! The rest should mostly be copy-and-pastable. Introduction This tutorial will describe how to set up and use rsnapshot, a remote backup solution based on rsync. Rsnapshot leverages the power of rsync to create scheduled, incremental backups. This procedure will demonstrate how to create local backups, as well as how to use another cloud server or your home computer as backup space. To complete the procedures in this tutorial, you will need to be logged in as root or preface all commands with sudo. Step One: Installing Rsnapshot and Configuring SSH Keys The first step in getting your content backed up is to install rsnapshot on the machine that you would like to use as your backup server. Rsnapshot is in Ubuntu s default repositories, so we can install it using apt-get: sudo apt-get install rsnapshot In order to backup another cloud server, your backup server will need to be able to connect through SSH to the cloud server you'd like to back up. We want rsnapshot to be able to use SSH without a password, so we need to generate SSH keys to authenticate. To generate a public and private key run this command on your backup server: sudo ssh-keygen -t rsa We do not want a passphrase for this key because we want these computers to be able to connect to each other without our intervention. Press ENTER through all of the prompts to accept the defaults. user@backupserver:~#: sudo ssh-keygen t rsa Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again:

Your identification has been saved in /root/.ssh/id_rsa. Your public key has been saved in /root/.ssh/id_rsa.pub. The key fingerprint is: The key's randomart image is: We now have a public and private key pair that will allow us to sign in to other servers from our backup server. We need to transfer our public key to the machine we will be backing up so that it knows that we are allowed to access it. sudo ssh-copy-id -i /root/.ssh/id_rsa.pub root@example.com Be sure to change example.com to the IP address or domain name of the server you will back up. Once that command executes, you should check that you are able to log-in to your server from your backup server without a password. sudo ssh root@example.com Once you've verified that you can connect correctly, exit out so that you are able to work on your backup server again. exit Step Two: Configuring Rsnapshot After you have installed rsnapshot, you will need to edit the configuration file. sudo nano /etc/rsnapshot.conf One thing to keep in mind while you are working with the rsnapshot configuration file is that each directory needs a trailing slash (/) to be read correctly. The first decision you will need to make is where you would like to store your backups. We will use the directory /backup as our backup location. Search for and edit the following variable to set the backup location. snapshot_root /backup/ If this directory does not already exist, rsnapshot will create it when it runs. You will also want to uncomment the cmd_ssh line to allow for remote backups. Remove the # from in front of the following line so that rsnapshot can securely transfer your data to the backup server. cmd_ssh /usr/bin/ssh

Remove the # from before the cmd_du line to enable accurate disk usage reports. cmd_du /usr/bin/du Next, we need to consider how many old backups we would like to keep. Since rsnapshot uses incremental backups, we can afford to keep older backups for awhile before removing them. We set these up under the BACKUP INTERVALS section of the configuration. We tell rsnapshot to retain a specific number of backups of each kind of interval. For the purposes of this guide, the default setting is good, but we will also uncomment the monthly interval so that we have some longer-term backups in place. Edit this section to look like this: ######################################### # BACKUP INTERVALS # # Must be unique and in ascending order # # i.e. hourly, daily, weekly, etc. # ######################################### retain hourly 6 retain daily 7 retain weekly 4 retain monthly 3 Another item that may need to be edited is the ssh_args variable. If you have changed the port number on the cloud server you are backing up, as suggested in the SSH tutorial, you ll want to uncomment the ssh_args section and use the same settings here. ssh_args -p 25000 Finally, you ll need to decide on what you would like to backup. If you are backing up locally to the same machine, this is as easy as specifying the directories that you want to save and following it with localhost/ which will be a sub-directory in the snapshot_root that you set up earlier. We will choose to backup the home directory and the etc directory. backup /home/ localhost/ backup /etc/ localhost/ If you are backing up a remote server or another droplet (cloud server), this can be configured here too. You just need to tell rsnapshot where the server is and which directories you would like to back up. backup root@example.com:/home/ remote-droplet/ rsnapshot is pull-based. Meaning that, without additional workarounds and configuration, you cannot push the backups to a remote server. Rather, with the SSH keys, they will be pulled into the server with rsnapshot installed. You ll want to change the example.com portion with the IP address or domain name of the server you

wish to back up. After your server name/ip address, you need to put a colon ":" followed by the directory path you would like to back up. The remote-droplet portion is the sub-directory where backups will be stored. You can name it whatever you d like. We are now finished with the initial configuration of rsnapshot. Save the /etc/rsnapshot.conf file before continuing. If you are using nano to edit, press Ctrl-X to exit and answer Yes at the prompt to save changes. Testing Your Configuration Before setting up the automation, we ll want to test that everything works as expected. To test that your configuration has the correct syntax, run: sudo rsnapshot configtest If your file is error-free, you will receive a Syntax OK message. If you did not receive this message, you need to go back and fix the mistakes that it tells you about. Next, we want to perform a dry run of one of the snapshot to make sure we are producing the expected results. We use the "hourly" parameter because hourly backups are the basic snapshot type that the other intervals will build off of. That means that we will get more information from "hourly" than if we had choosen "daily" or "weekly". sudo rsnapshot -t hourly If the generated output looks correct, you can remove the -t option to try your setup for the first time. sudo rsnapshot hourly This will run the backup that we setup in our configuration file. For this tutorial, rsnapshot created a /backup directory and then created the directory structure under it that organizes our files. Automating the Process With rsnapshot working correctly, the only thing left to do is to schedule it to run at certain intervals. We will use cron, a linux scheduler, to make this happen. Luckily, rsnapshot includes a default cron file that we can edit to our liking. We re going to edit this file with nano again. sudo nano /etc/cron.d/rsnapshot The scheduling is currently commented out. We re going to remove the # character from the beginning of the scheduling section to activate these values. # This is a sample cron file for rsnapshot. # The values used correspond to the examples in /etc/rsnapshot.conf. # There you can also set the backup points and many other things.

# # To activate this cron file you have to uncomment the lines below. # Feel free to adapt it to your needs. 0 */4 * * * root /usr/bin/rsnapshot hourly 30 3 * * * root /usr/bin/rsnapshot daily 0 3 * * 1 root /usr/bin/rsnapshot weekly 30 2 1 * * root /usr/bin/rsnapshot monthly These settings will run add a snapshot to the hourly directory within our /backup/ directory every four hours, add a daily snapshot everyday at 3:30 am, add a weekly snapshot every Monday at 3:00 am, and add a monthly snapshot on the first of every month at 2:30 am. It is important to stagger your backups and run larger backup intervals first. This means running the monthly backup first and progressing to shorter intervals from there in order, as we've done in this tutorial. This is necessary so that the program does not get caught up trying to do multiple backups at the same time, which can cause problems. By Justin Ellingwood