C
'Captain' Kirk DeHaan
I am trying to automate a disk backup process using Windows NT
ntbackup. I want to have the date associated with the backup file
name. I am having trouble getting Perl to translate the file name in
the command I am trying to execute. Here is what I have.
$date = `udate +%m%d%y`;
$date =~ s/\n//;
$newname = "StormC $date.bkf";
print $newname;
exec 'C:\WINDOWS\SYSTEM32\ntbackup.exe', 'backup systemstate
"@D:\Batch Files\StormC.bks" /f "S:\Backups\$newname" /v:yes /r:yes';
If I run this $newname is printed as StormC 040804.bkf. This is what
I want considering this is posted on 040804. Ntbackup syntax requires
the double quotes around the various arguments in the command string.
The backup will start but the file name for the backup becomes
$newname. I have looked but cannot find how to get perl to preprocess
the variable before executing the backup command.
Where am I going wrong or what am I leaving out?
Kirk
"Moe, Larry, the cheese!", Curly
ntbackup. I want to have the date associated with the backup file
name. I am having trouble getting Perl to translate the file name in
the command I am trying to execute. Here is what I have.
$date = `udate +%m%d%y`;
$date =~ s/\n//;
$newname = "StormC $date.bkf";
print $newname;
exec 'C:\WINDOWS\SYSTEM32\ntbackup.exe', 'backup systemstate
"@D:\Batch Files\StormC.bks" /f "S:\Backups\$newname" /v:yes /r:yes';
If I run this $newname is printed as StormC 040804.bkf. This is what
I want considering this is posted on 040804. Ntbackup syntax requires
the double quotes around the various arguments in the command string.
The backup will start but the file name for the backup becomes
$newname. I have looked but cannot find how to get perl to preprocess
the variable before executing the backup command.
Where am I going wrong or what am I leaving out?
Kirk
"Moe, Larry, the cheese!", Curly