[madpenguin.org...]
This is very acheivable of you are intending to backup the tar file to another server on your network.
Mack.
#!/usr/bin/perl
use Archive::Tar;
die "Usage: at.pl <dir> [<dir>...]\n" unless @ARGV;
my $tar = Archive::Tar->new;
for my $dir (@ARGV) {
$dir =~ s'/+$'';
$tar->add_files(glob "$dir/*");
}
$tar->write('files.tar');
$ cd /home/domain1
$ at.pl public_html
For full details, take a look at perldoc Archive::Tar. If you're using this for anything but a small number of files, you should probably use the os tar cmd instead. Also, this script is very basic - it doesn't do much error checking, and doesn't handle nested directories correctly.