User Tools

Site Tools


usages:backup-copy
Usage: backup-copy [OPTION...] [--] [repository]
Backup interesting files as set in the config file.

Simple usage:
backup-copy # does a backup - put this in cron!!
backup-copy -l # shows what backups are available
backup-copy --delta :now -v # shows what's changed since last backup
backup-copy -f /etc/passwd # show distinct versions of that file

Details.

Backups will go to:
<repository>/backup-copy/$HOST/YYYY/MM/DD-hh_mm

with <repository> in the form of either 'hostname:directory' or
'directory' (default is /var). 'directory' must already have a subdirectory
'backup-copy/$HOST' otherwise the --init option can be given to create it.

If using a remote system as <repository>, you need to have the ssh
key pushed to the remote for login without password.

Environment parameters can be set in the config file as follows:

MUST_BE_ROOT="yes" # to restrict to root (or "" or unset)
DEFAULT_DESTINATION= # repository to use (overridden by a repository on the
                       command line)
TEST_FILE= # invariant inoded file to test consistency
EXCLUDES= # list of rsync patterns to exclude
INCLUDES= # list of rsync patterns to include
EXPIRE= # remove backups older than this number of days
KEEP_MONTHLY= # only keep one backup per month of anything older than this
Options:

  -b, --brief                On all diff operations, report only whether the
                             files differ, not the details of the differences.
  -c, --config=config-file   override the config file (the default is the first
                             in the list:
                             /home/bhepple/.config/backup-copy.achar
                             /home/bhepple/.backup-copy.achar
                             /home/bhepple/.config/backup-copy
                             /home/bhepple/.backup-copy /etc/backup-copy)
                             Default is '/etc/backup-copy'.
  -C, --check-links=dates    don't backup - just check the backup tree ensuring
                             that hard links are correct (this can be slow,
                             particularly on a remote repository). The argument
                             'dates' is in the format
                             '[first|last|prev|YYYY/MM/DD-HH_MM[,last|prev|YYYY/MM/DD-HH_MM]'.
                             The dates may be wildcarded (with * and ?) but if
                             two dates are specified, the first may not be
                             wildcarded. The dates 'first', 'last' and 'prev'
                             are expanded to the first, last and previous
                             backup dates respectively. If only one date is
                             given, then all files in the backup repository are
                             compared to the files under that date directory.
                             If two args are given then the comparison is
                             between the first date directory and the second
                             one(s) - but intermediate dates are not
                             interpolated. eg to check the latest backup
                             against the previous one, use 'prev,last'. Note
                             that when duplicates are found then the new link
                             is created using the first date directory as the
                             base.
      --debug                even more verbosity
      --delta=dates          don't backup - just diff two backups. The dates
                             are given as '[date1][,date2]' with a date in the
                             format 'first|last|prev|now|YYYY/MM/DD-HH_MM' eg
                             '2011/01/18-21_13,2011/01/26-21_13'. A blank date
                             means the last (latest) backup. The dates 'first',
                             'last' and 'prev' are expanded to the first, last
                             and previous backup dates respectively. A date of
                             'now' compares against the live system (this can
                             be quite slow on a remote backup as the files must
                             be downloaded before the diff is done. Fast on a
                             local backup.) Thus to compare the live system
                             with the latest backup use ',now'.  You can get
                             the list of available backups with the --list
                             option. The number of files that differ is
                             returned in the exit code.
  -D, --diff                 do a diff after the backup
  -f, --file-vers=file       don't backup - just list the distinct versions of
                             'file' available in the repository with their
                             sizes. Note that this isn't terribly useful if run
                             on a directory or symbolic link.
  -H, --host=host            override the host name. Default is 'achar'.
  -i, --init                 initialise repository if necessary
  -l, --list                 don't backup - just list the backups in the
                             repository
  -n, --dryrun               dry run - just print what would be done
      --progress             show progress
  -q, --quiet                be quiet
  -w, --warn                 warn about suspicious filenames
  -h, --help                 print this help message
  -V, --version              print version and exit

Mandatory or optional arguments to long options are also mandatory or optional
for any corresponding short options.
usages/backup-copy.txt · Last modified: 2019/07/09 09:57 (external edit)