截屏视频帮助

Delete files and folder after backup completed

创建时间: 05 7 月 2013 • Updated: 23 8 月 2013 | 12 条评论
iaw 的图片
此问题已解决。 请查看解决方案。

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

操作系统:
讨论 归类至以下社区:

评论 条评论跳转至最新评论

Marianne 的图片

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

解决方案
iaw 的图片

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

Thanks

Marianne 的图片

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 的图片

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 的图片

...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 的图片

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.

解决方案
iaw 的图片

Thanks for all the valued suggestions.

@Alex: great, I will give it try.

Alex Zn 的图片

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

jim dalton 的图片

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 的图片

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

Regards,

IAW
 

Marianne 的图片

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