K&S Pritchard Enterprises, Inc.

K&S Pritchard Enterprises, Inc.
Contact Us
About Us
Community Projects

Search only this site


backup - automates copies of remote filesystems


backup [ <options> ]


This script is designed to take advantage of the fact that disk is cheap. The idea is to have a system with enough disk to make a duplicate of whatever data you care about.

By default, this will be done filesystem-by-filesystem with rsync running over ssh, but the mechanism is flexible enough to back up just about anything.


Add flags to rsync (or whatever the backup command is set to).

In the past, this was especially useful for occasionally running rsync with --delete (--extraflags=--delete), but now that this program saves backup copies of everything, that's part of the default command.

To add multiple options, use --extraflags="--option1 --option2" or use --extraflags multiple times.

Only backup host. (This can be used multiple times to backup multiple hosts.)

The default is to backup all hosts.

Backup up to number systems at once.

The script creates directories under path for each system.

Use filename for the config file. The default is /etc/backup.conf.

Look for files describing what will be backed up under path. The default is /etc/backup.d.

This script will look for directories named monthly, weekly, daily, and unscheduled under this directory. The files must be under those directories.

Makes rsync more verbose (equivalent to --extraflags="--verbose --progress"). In a future revision, it might also make this script a bit more verbose.

Spews lots of debugging information as the program runs. It might be useful when debugging problems, or it might not.

This is equivalent to adding ``debug=yes'' to the config file.

Sets the I/O timeout in seconds for rsync.

Run daily backups. This is the default if no hosts or other schedule (--weekly or --monthly) are specified.

Run weekly backups.

Run monthly backups.


Configuration options can be given in this file in the form
    parameter = value
Setting this option to ``yes'' is equivalent to adding --debug to the command-line.

default command
This can be used to specify an alternative default command. Certain special strings can be used, including DEFAULT. See COMMANDS.

This is equivalent to the --backupdir command-line option.

This is equivalent to the --maxchildren command-line option.

This is equivalent to the --configdir command-line option.

This is equivalent to the --timeout command-line option.

Each host to be backed up should have a file under this directory. The file's name must be the name of the host to backup.

The format of the file is

    /path/to/backup     command

The command is optional.


Any commands to run specified in the configuration files will have the following substitutions performed on them:

This will be replaced with the default command.

This will be replaced with any flags specified with --extraflags on the command line.

This will be replaced with the name of the host being backed up.

This will be replaced with the path being backed up.

All commands are run from the directory where backups for that host and filesystem should be stored.


rsync(1), ssh(1), run1(1), mount(8), smbmount(8), umount(8)


Steven Pritchard <steve@silug.org>