memo.xight.org

日々のメモ

backuper.pl

source

#!/usr/bin/env perl
use Date::Simple ('date','today');

my $HOME = q(/path/to/home);
my $BACKUP_DIR = $HOME.q(/backup);
my $tar = q(/bin/tar);

$date = today();

# print "$tar czvf $HOME/$date.tar.gz $HOME/public_html $HOME/work\n";
`$tar czvf $BACKUP_DIR/home-$date.tar.gz $HOME/public_html $HOME/work`;
`$tar czvf $BACKUP_DIR/www-$date.tar.gz /var/www`;