The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

File::Backup - For making rotating backups of directories

SYNOPSIS

  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'),
  );

DESCRIPTION

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.

BUGS

You can't make two backups of the same stuff in one second, because they'll try to have the same name.

AUTHOR

Ken Williams (ken@forum.swarthmore.edu)

COPYRIGHT

Copyright 1998 Ken Williams. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

perl(1).