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
Ok, great! This is a very common arrangement.
Some tips:
Here’s another thread where I shared some of my old troubleshooting techniques that will likely help you in testing:
Let me know if this answers your questions!
Hi,
You can pass the job status as an argument to the post-process script. And you need to decide your business logic based on the status value.
Please check this documentation page and check the additional argument -status.
https://documentation.commvault.com/commvault/v11_sp20/article?p=12782.htm
Thanks,
Sunil-
Hey
Assuming you’d set this to run AFTER the backup phase, then you likely won’t encounter any issues with premature deletion; however, if the backup is killed BEFORE the script portion runs, then you’ll likely the files sitting in place where you expected them to have been deleted.
Is your intent to stage files in a folder, have them get backed up, then delete them after (to clear the staging area)?
Thanks!
post process
C:\Users\xxxx\Documents\echo.bat "-status 1"
While we wait for
post process
C:\Users\xxxx\Documents\echo.bat
waiting for confirmation....
You should be able to test it out with a VERY small subclient with some random text files thrown in. Set the subclient to that folder only, set the script syntax to delete that folder’s content and run a full and see what happens.
the correct syntax is
post process
C:\Users\xxxx\Documents\echo.bat "-status 1".
or
post process
C:\Users\xxxx\Documents\echo.bat
should the status be tested outside or inside the script?
Thanks
I’ll tag in
You can always just do it within the script as you said, though it might be tougher to monitor the phase of the backup/scan, etc.
“Is your intent to stage files in a folder, have them get backed up, then delete them after (to clear the staging area)? “ YES
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.