07-05-2013 07:13 PM
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
Solved! Go to Solution.
07-05-2013 08:42 PM
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).
07-07-2013 03:01 AM
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.
07-05-2013 08:42 PM
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).
07-05-2013 08:52 PM
So, is it posible for auto schedule? (no manual operator interuption)
Thanks
07-05-2013 09:12 PM
It cannot be scheduled using NetBackup. As per my post above - can only be done manually from the client.
The only way to automate it is to create a script on the client and use another scheduler (e.g. cron on Linux client) to schedule it.
07-05-2013 10:17 PM
Another way to start a user archive is to create a backup with a full and a user archive schedule.
Use the automatic backup to backup a single file and start a bpstart_notify script.
The script will have a bpbackup command to start the user archive backup.
when I use this approach and because of the bpstart timeout I have a separate bpbackup script and call it from bpstart_notify.
This is like the approach of a database backup
07-07-2013 12:34 AM
yes,you can follow Stefanos Monovasios advise.
07-07-2013 01:09 AM
...bit of a nonsense post. Please post when you have something of value to add!
Thanks!
07-07-2013 03:01 AM
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.
07-07-2013 08:37 PM
Thanks for all the valued suggestions.
@Alex: great, I will give it try.
07-07-2013 11:18 PM
If it will work for you, do feel free to mark my comment as solution :)
07-09-2013 09:10 AM
User archiveas per MVDB: its an attribute of the schedule within a policy. Approach with caution at all times, especially if writing wrappers around these things.
Im sure you could just write a post script and kill your data once the backup status is good as perl Alex, ie use a backup policy, but well you need to be careful with files in use, half written and so on.
jim
07-14-2013 09:00 PM
Thanks all for the valued reply.
I will test it whenever I'm in the implementation phase.
Regards,
IAW
08-22-2013 05:33 AM
NO!!! This is NOT a solution!
A solution is a post that has answered your query!