Rdiff-image-snap

 

NAME

rdiff-image-snap - create snapshots to another file system

 

SYNOPSIS

rdiff-image-snap [options] source... destdir

 

DESCRIPTION

rdiff-image-snap creates a snapshot (ie a backup) of directories to another directory on a local (but perhaps networked) file system. Thus each snapshot is a complete copy of all files in the backed up directories. The first snapshot uses the same amount of space as the original files, but subsequent snapshots only need the space occupied by changed files.

rdiff-image-snap is designed for use with an external drive. Thus you can say the file system you want to back up to must be mounted first, and say where it lives by supplying a device name (eg /dev/sda2), or uid or label. The file system will be checked if dirty (see fsck(8)) prior to mounting.

The backups are placed into directories named:

backup-yyyymmdd-hhmmss
Yyyymmdd-hhmmss is the local date-time the backup was started. The oldest backups are automatically purged when space runs low.

 

OPTIONS

--exclude=path
Exclude path from the backup. Path may contain wild cards, and if a path ends in /** all files under that directory path are excluded. This option is passed directly to rsync.
--exclude-from=filename
Identical to --exclude but the files to exclude are read from filename. This option is passed directly to rsync.
-f free, --min-free=free
After a successful backup purge old backups until there are more than free blocks of free space available to normal users. If free has a % suffix it is taken as a percentage.
-m filesystem, --mount=filesystem
The directory to back up to (destdir) lives on filesystem. Filesystem can be a device name that starts with a "/", a file system label or a file system uid that is prefixed with ":" (see blkid(8)). If the file system isn't already mounted it will be checked if it isn't clean, then mounted on a temporary directory while the backup is done.
-n email[,...], --notify=email[,...]
Send email to email if the backup fails.
-v, --verbose
Print the file names as they are transferred. This option is passed directly to rsync.
-x, --one-file-system
Do not cross file systems when reading backup data. This option is passed directly to rsync.

 

ARGUMENTS

destdir
Put the snapshots under destdir. It must exist. If --mount is used destdir is relative to the root of the specified file system.
source ...
The directories to be backed up. The full path given will be appear under destdir.

 

OPERATION

This program is just a wrapper around rsync(1). Rsync conserves space by creating hard links to a previous backup of the file if it is unchanged.

If ionice(8) is available, all disk intensive commands will be run at the idle I/O priority.

rdiff-image-snap will operate more efficiently if you use the --free option to ensure there is always enough free space to hold the next backup.

 

EXAMPLES

This example shows how one might going about doing your first backup:

# mke2fs -t ext4 -L my-backup-vol /dev/sdx2
# rsync-image-snap -m :my-backup-vol -x / /

 

BUGS

FUSE mounts such as the one used by Gnome VFS and bind mounts can confuse the --one-file-system option of rsync. If this is a problem the work around is to avoid the mount points using --exclude, eg --exclude=/home/*/.gvfs.

rdiff-image-snap can take a while to exit if terminated or interrupted. This is usually because the umount(2) call is flushing cached data to disk. If you somehow managed to stop this process the file system on the disk would be corrupted, but fortunately the kernel ensures it is near impossible to stop. Be patient.

rdiff-image-snap doesn't really belong to the rdiff-tools. It is just a tag along.

 

SEE ALSO

blkid(8), rsync(1).

 

AUTHOR

Russell Stuart <russell-rdiffimage@stuart.id.au>