trying to write a subroutine to copy all the files in a directory, as well as the subdirectories and their files
use File::Copy::Recursive qw(dircopy );
my ($new_date) = &date_to_unix(&get_date);
my $newdirname = $new_date;
if ((-e "$backup_dir/$newdirname")) {
&html_admin_home("backup already exists for this date");
}
else {
my $src = "$db_data_path";
my $dest = "$backup_dir/$newdirname";
dircopy($src, $dest) or die "Can't dircopy: $db_data_path $!";
}
getting following error although ...data is the directory i want to copy
Can't dircopy: /var/home/delicia/delicia.com/cgi-bin/public/data No such file or directory
Code:
use File::Copy::Recursive qw(dircopy );
my ($new_date) = &date_to_unix(&get_date);
my $newdirname = $new_date;
if ((-e "$backup_dir/$newdirname")) {
&html_admin_home("backup already exists for this date");
}
else {
my $src = "$db_data_path";
my $dest = "$backup_dir/$newdirname";
dircopy($src, $dest) or die "Can't dircopy: $db_data_path $!";
}
getting following error although ...data is the directory i want to copy
Can't dircopy: /var/home/delicia/delicia.com/cgi-bin/public/data No such file or directory