How to archive files using a NetBackup policy?

By | February 4, 2018

Some days ago I got email from my reader with question about how to archive files in NetBackup. NetBackup provides not only backup but also archiving as well 😛 Sometimes it can be useful to create a folder or folders where users can copy/move files and those files are archived (copied and deleted from an original place) and kept within specific time (retention). Really similar how Enterprise Vault works, however NetBackup does not leave shortcuts to archived files 😉

In this post you can find answers for the following questions:

  • How to manually archive files using NetBackup?
  • How to automatically archive files using NetBackup?

I will show it on Windows Client but also Linux as well. Let's start 😉

At first, we need to create a NetBackup policy with User Archive scheduler. This policy is really important because archiving in NetBackup is initiated from the Client!

To create the Archive Policy please follow the below steps.

  1. Click "New Policy" and enter Policy name.How to archive files using a NetBackup policy
  2. In the Attributes tab, please choose MS-Windows or Standard Policy type. Also you need to specify some additional parameters such as Destination (Policy storage) etc.How to archive files using a NetBackup policy Windows
  3. In the Schedules tab, please click New to add a new scheduler.How to archive files using a NetBackup policy Windows 2
  4. Enter a scheduler name. Select type of backup as User Archive and select retention.How to archive files using a NetBackup policy Windows 3
  5. In the Start Window tab, please define a time window during which archive jobs can start. Then click OK.How to archive files using a NetBackup policy Windows 4
  6. Review a time window. Then Click the Clients. tab.How to archive files using a NetBackup policy Windows 5
  7. In the Clients tab, please add all clients to be archived.How to archive files using a NetBackup policy Windows 6
  8. You do not need to add anything in Backup Selections tab. Just click OK now to save the policy.

We have just created the archive policy. As I mentioned earlier, an archive job is initiated from client so now we have to do it. We have two possibilites:

  • manually - via BAR GUI on client or
  • automatically via script + Task Scheduler (Windows) or cron (Linux)

Manually Archive files on Windows

To archive files manually please follow the below steps:

  1. Launch Backup, Archive and Restore Gui.
  2. Select folder/files for archiving and click icon shown on the below figure.How to archive files using a NetBackup policy Windows BAR GUI
  3. Select Archive files (delete files after successful backup). Click Start Backup to initiate archiving.How to archive files using a NetBackup policy Windows BAR GUI 2

 

Automatically Archive files on Windows

To archive files (on Windows client) automatically please follow the below steps:

  1. Create a text file (e.g. list.txt) with all sources for archiving. For example: f:\Archving Folder\*.*.
  2. Create a batch script (e.g: archive.bat) with the following command:

    "C:\Program Files\Veritas\NetBackup\bin\bparchive.exe" -p policy_name -f txt_file

    In my case:

    "C:\Program Files\Veritas\NetBackup\bin\bparchive.exe" -p Archive_policy -f c:\list.txt

  3. Run Task Scheduler. Right click and select Create Basic Task.How to archive files using a NetBackup policy Windows task 1
  4. Enter Task name. Click Next.How to archive files using a NetBackup policy Windows task 2
  5. Select Task frequency. Click Next.How to archive files using a NetBackup policy Windows task 3
  6. Select Task start time. Click Next.How to archive files using a NetBackup policy Windows task 4
  7. Select Start a program. Click Next.How to archive files using a NetBackup policy Windows task 5
  8. Browse the script that was prepared earlier. Click Next.How to archive files using a NetBackup policy Windows task 6
  9. Click Finish to add the Task.How to archive files using a NetBackup policy Windows task 7
  10. Right click on created task and click Properties. Then select Run whether user is logged on or not. Click OK to save new settings.How to archive files using a NetBackup policy Windows task prop

 

The below figure shows that an archive job is done successfully.

How to archive files using a NetBackup policy Windows success

Automatically Archive files on Linux

To archive files (on Linux client) automatically please follow the below steps:

  1. Create a text file (e.g. list.txt) with all sources for archiving. For example: /home/archive/Archving Folder/*.*.
  2. Create a bash script (e.g: archive.sh) with the following command:

    /usr/openv/netbackup/bin/bparchive -p policy_name -f txt_file

    In my case:

    #!/bin/sh
    /usr/openv/netbackup/bin/bparchive -p Archive_policy -f /home/archive/list.txt

  3. Make the script is executable.

    chmod +x /home/archive/archive.sh

  4. Add cron job (run crontab -e) - add the following line:

    30 18 * * * /home/archive/archive.sh

Conclusion

NetBackup does not provide automatic archiving out of box... Fortunately using Task Scheduler or Cron we can archive files automatically 🙂

Author: Mariusz

Architect (~ 15 years experience based on passion...) with strong background as a System Administrator and Engineer. Focused on Data Center Solutions: Virtualization/Cloud Computing and Storage/Backup Systems. Currently living in Poland.