Delete files and folder after backup completed
Hi,
I use NBU 7.x
I want to delete files and folders after the file system backup completed successfully.
Is there any feature for this? or I need to create post script?
Any example script for this?
Thanks,
IAW
We call it User Archive and can only be done manually from the client.
On the master, you need to have a policy for the client with a schedule of User Archive type with an open window during which this action will be allowed.
If there is a file list in Backup Selection, it will have no effect on the archive.
On the client, a local admin can open BAR window, select folders/files, and start the archive.
The user can also run bparchive from cmd. (See Commands manual for usage).Hi, there is no feature for this in NBU, but it may be done using the next steps:
1. Get file bpend_notify.cmd from "bin\goodies" on master or media server and copy it to client computer.
This is script wich will be executed any time you run policy, if you want to bind it to some specific schedule (for example run it only after full backup) rename it like bpend_notify[[policy_name].[schedule_name]].cmd
Because script runs any time you have to verify is schedule was successful, in other case we may delete files that was not backed up.
2. Replace all in bpend_notify.cmd with next:
echo off
echo =============================================== >> bin/BACKUP_RESULT.txt
if "%4" == "FULL" goto FULL
goto EOF
:FULL
if NOT %5% == 0 goto FAIL
echo %date% %time% >> bin/BACKUP_RESULT.txt
echo full backup finished on %1 using policy %2 with schedule %3 and status SUCCESSFULL >> bin/BACKUP_RESULT.txt
echo start deleting files... >> bin/BACKUP_RESULT.txt
The last string should be delet command. But before you run it test it very well in other case there is a risc to destroy your data.