Video Screencast Help

Delete files and folder after backup completed

Created: 05 Jul 2013 • Updated: 23 Aug 2013 | 12 comments
iaw's picture
This issue has been solved. See solution.

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

Operating Systems:

Comments 12 CommentsJump to latest comment

Marianne's picture

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).

 

Supporting Storage Foundation and VCS on Unix and Windows as well as NetBackup on Unix and Windows
Handy NBU Links

SOLUTION
iaw's picture

So, is it posible for auto schedule? (no manual operator interuption)

Thanks

Marianne's picture

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.

Supporting Storage Foundation and VCS on Unix and Windows as well as NetBackup on Unix and Windows
Handy NBU Links

StefanosM's picture

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

CraigV's picture

...bit of a nonsense post. Please post when you have something of value to add!

Thanks!

Alternative ways to access Backup Exec Technical Support:

https://www-secure.symantec.com/connect/blogs/alte...

Alex Zn's picture

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.

 

SOLUTION
iaw's picture

Thanks for all the valued suggestions.

@Alex: great, I will give it try.

 

Alex Zn's picture

If it will work for you, do feel free to mark my comment as solution :)

jim dalton's picture

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

iaw's picture

Thanks all for the valued reply.
I will test it whenever I'm in the implementation phase.

Regards,

IAW
 

Marianne's picture

NO!!! This is NOT a solution!

A solution is a post that has answered your query!

Supporting Storage Foundation and VCS on Unix and Windows as well as NetBackup on Unix and Windows
Handy NBU Links