Automate data backup at the command line

Servers

Using rdiff-backup, you can also back up servers in the intranet. Note that you do need to install the application on the server. To run a backup over SSH, at the remote client prompt enter:

rdiff-backup <Username>@<Server-IP::<Source-Directory> <Backup-Directory>

This command backs up the source directory from the server on the local client. If the backup also includes files to which only root has access, you will need to log in with the appropriate privileges.

Displays

Rdiff-backup, like all other tools being reviewed here, has a collection of parameters for managing backups. To view the content of a backup, enter

rdiff-backup -l <Backup-Name>

at the prompt.

Because rdiff-backup does not output status messages during the backup runs, it also makes sense to enter the -v6 parameter to switch to the highest verbosity level. The software then outputs all the processed files. Additionally, after launching the backup, various status messages appear about enabled and disabled parameters (Figure 7).

Figure 7: rdiff-backup gives you far more information than other backup programs – if you tell it to do so.

The --compare and --list-increments parameters provide information about the modified files and the different backup points. Using the command

rdiff-backup-statistics <Backup Directory>

you can also retrieve statistical data for the backup directory (Figure 8).

Figure 8: One of the various statistical data displays makes it easier for you to check the backups.

Exceptions

As with other backup programs, you can also exclude files or directories from the backup. This can be beneficial, for example, if the backup path includes directories for temporary files that you don't want to save. In such cases, use the --exclude parameter to exclude individual files.

If you need to exclude complete directories from the backup run, you can use the --exclude-filelist parameter; you need to specify a file containing the paths of the files to be excluded. The file has to be created manually.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Charly's Column: Backup2l

    At his cozy home, sys admin Charly has always used rsnapshot to back up his data. Although things will be staying this way for server backups, he has found something more manageable for backing up the Kühnast family's desktop PCs.

  • Rotating Backup with rsync
  • Admin Workshop: Backups with Rsync

    It is often inefficient to fire up a tape drive whenever you need to back up files or restore a backup. The Rsync tool pushes critical files to a second computer, where you can access them easily.

  • Admin Workshop: Backups

    Data always seems to get lost at exactly the wrong moment, but the right backup strategy can help you restore those missing files.

  • Areca Backup

    Sometimes you just need to back up a few directories on a computer, not administer a distributed installation or an array of disks. Areca Backup gives you hassle-free backups of individual hard drives.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News