shell help

I"m writing a shell script to backup parts of my site and it seems its getting hung up on something. Anyway heres the code:

#!/usr/bin/perl

$date=`/bin/date +%Y-%m-%d`;
system("rm -rf /home/gibackup");
system("mkdir /home/gibackup");
chdir("/home/gibackup");
system("mysqldump removed");
system("cp -r /home/gi/public_html/images /home/gibackup");
system("tar -cvpzf /home/ginventbackup/gibackup-$date.tar.gz /home/gibackup/");


when I run the script I get this output:
tar: Cowardly refusing to create an empty archive
Try `tar --help' for more information.
sh: .tar.gz: command not found

It seems to have to do with the date variable inside the archive name. Any help would be appreciated.

 

 

 

 

Top