BACKUP

Section: Maintenance Commands (8)
Updated: UofToronto
Index Return to Main Contents
 

NAME

backup - save files that have changed in the last little while  

SYNOPSIS

backup [ -devz -b# ] [ -c backup.conf ] [ -o /backup ] [ /path ... ]  

DESCRIPTION

Backup copies to a special filesystem hierarchy all files which have been modified since the previous run of backup on that subtree of the filesystem. The subtree(s) may be specified explicitly on the command line. If none are given, a configuration file (default is /local/etc/backup.conf) is read to determine which subtrees to scan for recently changed files. If subtrees are explicitly listed, a run is forced. Otherwise, backup will only do its deed if the subtree is due for backing up as indicated by the interval time, and the last backup scan time, in the configuration file. If the subtree is not found in the configuration file, all files changed during the last day will be selected.

The format of the configuration file is:

-
lines starting with # are ignored.
-
all other lines contain four space-separated fields:
Field 1 is the path name of a subtree to back up.
Field 2 is the desired interval between backups.
Field 3 is the name of a filter file containing glob patterns, one per line, describing names of files to ignore when scanning the subtree.
Field 4 is a timestamp in the exact syntax of ctime(3).

This is a sample configuration file:

# path           intvlfilter filelast done
/usr             8h/dev/nullSat Apr 30 00:33:03 1988
/homes/neat/car  8h/etc/filter.uSat Apr 30 00:33:03 1988
/homes/neat/cdr  8h/etc/filter.uSat Apr 30 00:33:03 1988
/var             24h/dev/nullSat Apr 30 00:33:03 1988

The first three fields are maintained manually (and defaulted if backup is given a subtree argument not appearing in the configuration file). The last field is maintained by the program itself. After every successful run, the configuration file is written out containing the updated timestamp information. The purpose of the configuration file is to allow all information be maintained in this form, and the backup program started very frequently by cron(8).

Backed up files are stored in a parallel directory hierarchy under the root of the backup hierarchy (by default /backup). Each backed up file has associated with it a directory whose relative pathname under the root of the backup hierarchy is its full pathname. This directory contains one or more backed up files in files named by the date of the backup. Thus, a user with a file

/homes/neat/car/user/src/stuff.c

that he has been working on and hence has been backed up a number of times might find a set of files

/backup/homes/neat/car/user/src/stuff.c/Apr30-06:05, /backup/homes/neat/car/user/src/stuff.c/Apr30-09:05,

and

/backup/homes/neat/car/user/src/stuff.c/Apr30-12:05.

Permissions and owner/group are copied with the files.

As the backups are very expensive in terms of file space only files of less than some size, currently 100 kilobytes, are saved. Files can be deselected by creating a filter file, and adding to it glob patterns that would match suspicious names. Typically, for example core, a.out, emacs temporaries like #* or *~ and many others, are not backed up.

When filespace usage on the backup root's file system passes a high water mark, currently 95%, backup deletes files in order by modification date until it has enough space under the high water mark to add new backup files.

Backup reads the entire i-list for the filesystem, saving information such as the modification time and type of the inode. Thereafter all the appropriate file names are identified by tree walks in the filesystem, and backed up. If files must be deleted from the backup hierarchy, then it does the same for the backup subtree (only deleting instead of backup up!).

The various options are:

-b
the argument is the largest size in kilobytes of files to consider backing up.
-c
specifies an alternate configuration file.
-d
turns a little bit of debugging output on.
-e
will not ignore executable files when looking for files to back up.
-o
specifies an alternate backup hierarchy to place backed up files.
-v
turns on verbosity, and can be doubled for more chatter.
-z
asks the program to go through the motions, but to not take any action whatsoever.
 

FILES

/backup                  - mounted filesystem for backups

/local/etc/backup.conf  - backup configuration information
 

INFO

Original idea by Ciaran O'Donnell of U of Waterloo, whose version was written in 1975. This is an independent reimplementation native to the SunOS environment, written by Rayan Zachariassen at U of Toronto (bug fixes and improvements to <rayan@ai.toronto.edu>).


 

Index

NAME
SYNOPSIS
DESCRIPTION
FILES
INFO

This document was created by man2html, using the manual pages.
Time: 19:07:51 GMT, February 02, 2023