File::Backup - For making rotating backups of directories
use File::Backup("backup"); backup( from => "/dir/to/back/up", to => "/destination/of/backup/files", torootname => root name of backup file (default is ""), keep => number of backups to keep in todir (default is 7), tar => path to archiving utility (default is "/usr/bin/tar"), compress => path to compressing utility (default is "/usr/bin/gzip"), tarflags => flags to pass to 'tar' (default is "-cf"), compressflags => flags to pass to 'cmpr' (default is ""), tarsuffix => suffix to put on the tarfile (default is '.tar'), );
This module implements a very simple backup scheme. In its barest form, it takes as input a source directory and a destination directory, and puts a backup of the source directory in the destination directory. You may specify a maximum number of backups to keep in the directory (the 'keep' parameter). By setting the 'keep' parameter to n, you will keep the n most recent backups. Specify -1 to keep all backups.
The backup will include a date string (of the format YYYY-MM-DD_hh-mm-ss) that will be used to figure out which files are the most recent. You can also give a string that will be used as the beginning of the backup's filename (before the date string), which may be useful if you're keeping backups of several different things in the same directory.
You can't make two backups of the same stuff in one second, because they'll try to have the same name.
Ken Williams (email@example.com)
Copyright 1998 Ken Williams. All rights reserved.