saveit - simple backup utility saveit [OPTION]... FILE... This command allows the creation of backup copies of files or directories with the following advantages: * single repository (a common directory) for all the saved objects. * a log file with a listing of saved objects is written in the the single repository. * simple versioning scheme, using the date and time as a suffix to the target object name. -a plain The file/directory to be saved is copied to the Base Backup Directory without creating the standard YYYYMMDD directory and without creating the target fullpath. If target exists, a the target is created and renamed appending .HH:MM to the original name. Not allowed with options -s, -i. -c comments to write into the log file -d Base Backup Directory Is used instead of the default directory /Backup.d Not allowed with option -i. -i backup in place creates a file/directory copy in the directory where you are running saveit. The name of the saved file/directory is created appending .YYYYMMDD-HH:MM to the original name. Not allowed with option -d, -a, -s, -o. -o overwrite The file/directory to be saved is copied to the Backup Directory without appending .HH:MM to the original name, then if the file exists in the backup area it will be overwritten. Not allowed with option -i. -s suffix only The file/directory to be saved is copied to the Base Backup Directory without creating the standard YYYYMMDD directory, always adding the suffix .YYYYMMDD-HH:MM to the original name. Not allowed with options -a, -i, -o. -v print version number and exit.

Save /etc/hosts in the default base backup directory
[root@spock]# saveit /etc/hosts copying /etc/hosts ===> /Backup.d/20010221/etc/hosts In /Backup.d you will find the log file log-20010221 [root@spock]# cat /Backup.d/log-20010221 -------------------------------------------------------------- Backup base directory /Backup.d Backup requested by localhost.localdomain!root Date (dd/mm/aaaa) 21-02-2001 Time 07:14 -rw-r--r-- root/root /etc/hosts

Save using the suffix only option.
[root@spocl]/saveit -s /etc/rmt copying /etc/rmt ===> /Backup.d/etc/rmt.20010221-07:40 [root@spock]# cat /Backup.d/log-20010221 -------------------------------------------------------------- Backup base directory /Backup.d Backup requested by localhost.localdomain!root Date (dd/mm/aaaa) 21-02-2001 Time 07:14 -rw-r--r-- root/root /etc/hosts -------------------------------------------------------------- Backup base directory /Backup.d Backup requested by localhost.localdomain!root Date (dd/mm/aaaa) 21-02-2001 Time 07:40 lrwxrwxrwx root/root /etc/rmt -> ../sbin/rmt The last line in the log file shows that the file we have saved is a link. Take a look to /Backup.d /Backup.d: drwxr-xr-x 3 root root 1024 Feb 21 07:14 20010221 drwxr-xr-x 2 root root 1024 Feb 21 07:40 etc -rw-r--r-- 1 root root 464 Feb 21 07:40 log-20010221 /Backup.d/20010221/etc/hosts /Backup.d/etc/rmt.20010221-07:40 If we have requested a saveit without options, the file /etc/rmt would be copied under the 20010221 subdirectory like /etc/hosts, but we asked suffix only, then the directory indicated the date is omited and the timestamp is added to the file. New saveit operations on /etc/hosts during 20010221 will be saved in /Backup.d/20010221/etc/ directory , and the new versions will be identified adding the timestamp suffix.

Save the file /SysAdmin.d/mypod in place
[root@spock]#cd /SysAdmin.d/mypod [root@spock]#saveit -i mypod copying file /SysAdmin.d/mypod ===> /SysAdmin.d/mypod.20010221-07:28 [root@spock]#ls -la log-* -rw-r--r-- 1 root root 259 Feb 21 07:28 log-20010221

Another save in place example
You want save in the current directory the file ../miman.tar.gz [root@spock]# pwd [root@spock]# /SysAdmin.d/work [root@spock]# saveit -i ../miman.tar.gz copying /SysAdmin.d/miman.tar.gz ===> /SysAdmin.d/work/miman.tar.gz

Configuration File
You can set your preferences in the file /etc/saveit.conf. The precedence in option analysis is: If an option is set on the command line this is the value used. If an option is NOT set on the command line and is set in the configuration file this value is used. If an option is NOT set either on the command line or in the configuration file, the default built-in value is used.

Example of /etc/saveit.conf
# # saveit configuration file # (/etc/saveit.conf) # # # All lines beginning with '#' are ignored # # Where should be store backedup files? #sv_base_dir=; export sv_base_dir # # Boolean Options: 1 -> yes , 0 -> no # Suffix only: # append a date suffix to the backup file, but # do not create a subdirectory with today's date. #sv_suffix_only=1; export sv_suffix_only # # Save all files in the current dir? #sv_save_inplace=1; export sv_save_in_place # # Save plain ? #sv_save_plain=1; export sv_save_plain # # Save with overwrite ? #sv_save_over=1; export sv_save_over

Log file
In the Base Backup Directory used, a log file will be created if not found, or information will be appended into it. The file is named log-YYYYMMDD. Every successful operation will write the following information: The backup base directory used, it can change between saves. The Real User Name Who requested the save. Date and time A listing of all files saved, showing file permissions, owner/group and name.

Base backup directory ownership and permissions.
The standard Base Backup Directoy (F</Backup.d>) is owned by the user that runs for the very first time saveit on the machine and creted with the following permissions: drwxr-xr-x Then if root is the "first user" and a non-privileged user tries to save a file in the standard directory the operation will fail. If a different Base Backup Directory is choosen, and doesn't exist, it will be created and owned by the user that requested the operations.

Relative path
The only relative path combinations managed properly are C<../ and ./>. Combinations like ../xx/.., etc are not supported. Francisco Mancardi, U&R Consultores - Argentina - (fman@uyr.com.ar) , (www.uyr.com.ar) Testing and suggestions: Sean Boran, (sean@boran.com) Boran Consulting