Hi, is possible run script to delete files after backup if ended ok ?
Thanks
Hi, is possible run script to delete files after backup if ended ok ?
Thanks
Best answer by Sunil
Sorry for the delay. Here is the example.
The Job Manager launches the command with the below arguments.
-bkplevel 1 -attempt 1 -status 1 -job 4
We are trying to access the 6th argument in the list for getting the job status.
I’ve created a sample script with this content.
D:\PostBackup>type postbackup.cmd
IF %6==1 (
echo "Backup Phase succeeded" >> C:\postBackup.log
)ELSE IF %6==2 (
echo "Backup Phase failed" >> C:\postBackup.log
)
echo %1 >> C:\postBackup.log
echo %2 >> C:\postBackup.log
echo %3 >> C:\postBackup.log
echo %4 >> C:\postBackup.log
echo %5 >> C:\postBackup.log
echo %6 >> C:\postBackup.log
And the script output from C:\postBackup.log is this.
"Backup Phase succeeded"
-bkplevel
1
-attempt
1
-status
1
This is how the script is configured in the subclient properties:
That’s all.
You can use %6 argument to access the jobStatus code inside your script.
So you can check IF %6==1 and delete the files you wanted to delete.
Thanks,
Sunil-
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.