Page tree
Skip to end of metadata
Go to start of metadata

Product Version: 6.0
Last Modified: 31 Dec 2015

Question

How to set up automated copying of a Backup Repository?

Answer

Starting from version 6.0, you can use backup copy job to copy your backups.

In older versions, Backup Repository copying can be automated using Pre and Post Job scripts in conjunction with product Command Line Interface.
In the below example we will describe how to copy a backup repository to USB drive in case the product is installed on Windows.

  1. Use command line interface to find out the Repository ID for your backup repository.
    The --repository-list command should be executed for this purpose.
  2. Create the pre and post job scripts:
    • Pre job script must attach the backup repository.
    • Post job script must detach the backup repository and copy it to the USB drive.
  3. Place the pre and post job scripts into the bin folder in the product installation folder.
  4. Configure your backup job to run the above-mentioned pre and post job scripts.
    The job must be set to wait for the pre job script to complete and should fail if the script fails.
  5. Run your backup job on demand or on schedule.
    The scripts will trigger copying of the entire repository content after each job run.

NOTE: Backup repository must be detached while copying the contents.

NOTE: You can use the same approach to copy the backup repository to a shared folder at another server.

Script Examples

Below you can find Windows script examples that copy the backup repository using Robocopy tool.
For Linux-based NAKIVO Backup & Replication deployments, we recommend to use Rsync utility.
In the current example we assume that:

  • Backup repository it is located in the root of C: drive.
    In this case the backups will be located in “C:\NakivoBackup” folder.
  • The ID of the backup repository is “1”.
  • The secondary location is USB drive F:

 

pre-job.bat
CD "C:\Program Files\NAKIVO Backup & Replication\bin"
CALL "C:\Program Files\NAKIVO Backup & Replication\bin\cli.bat" --repository-attach 1
post-job.bat
CD "C:\Program Files\NAKIVO Backup & Replication\bin"
CALL "C:\Program Files\NAKIVO Backup & Replication\bin\cli.bat" --repository-detach 1
robocopy "C:\NakivoBackup" "F:\NakivoBackup" /mir /z /is /r:10 /w:15 /nfl /ndl
  • No labels