|
I am trying to get this script to work. I have the 1st part working which runs NTBACKUP. But i cannot get the second part to work which goes out, gets the log file, renames it, and copies it to a designated place. Any help would be greatly appreciated.
Problem script:
; DATE : 6/28/2002 ; ; COMMENT: Copies NT Backup log files to specified location, renames them to date of Backup ; ======================================================================== ;Break on CLS ; ======================================================================== $server = "@WKSTA" ; Server name $logdir = "\\$server\backup" ;Share where NTBACKUP log files exist $logfile = "\\$server\backup\*.log" ;Logfiles $logdest = "\\ocnfp2\it_share\backups ;Destination of log files $buday = @MDAYNO" - "1" ; ======================================================================== ;Rename log file ; ======================================================================== select case exist ("$logdir\backup01.log") shell '%comspec% /c ren "$logdir\backup01.log" "$buday @month @year.log"' case exist ("$logdir\backup02.log") shell '%comspec% /c ren "$logdir\backup02.log" "$buday @month @year.log"' case exist ("$logdir\backup03.log") shell '%comspec% /c ren "$logdir\backup03.log" "$buday @month @year.log"' case exist ("$logdir\backup04.log") shell '%comspec% /c ren "$logdir\backup04.log" "$buday @month @year.log"' case exist ("$logdir\backup05.log") shell '%comspec% /c ren "$logdir\backup05.log" "$buday @month @year.log"' case exist ("$logdir\backup06.log") shell '%comspec% /c ren "$logdir\backup06.log" "$buday @month @year.log"' case exist ("$logdir\backup08.log") shell '%comspec% /c ren "$logdir\backup08.log" "$buday @month @year.log"' case exist ("$logdir\backup09.log") shell '%comspec% /c ren "$logdir\backup09.log" "$buday @month @year.log"' case exist ("$logdir\backup10.log") shell '%comspec% /c ren "$logdir\backup10.log" "$buday @month @year.log"' endselect
sleep 2
copy "$logdir\*.*" "$logsest"
sleep 1
del "$logdir\*.*"
exit
|