The installation of BlueCat Server Update Services (BSUS) comes with a backup and restore Python script that you can use to back up the contents of your BSUS containers, then restore them to the same (or a different) BSUS host later. You can run this script as part of an automated backup mechanism in case of a catastrophic hardware or software failure. This script is located in the BSUS container as:
data_backup_restore.py
backup_jobs.sh. This is not the same as the script
described here./home/bluecat/bsus232-qa/bsus_23.2.1248_2023-07-26_10-03-29.tgz.
You can also view the contents of the file volume/manifest.txt.Backup script setup
This script uses the open source package Busybox, a collection of common UNIX/Linux utilities. If Busybox is not already present ony your system and BSUS can access the internet, the script will attempt to retrieve it from the Docker Hub website.
If BSUS cannot access the internet, you must manually download the Busybox image, save it to an archive store, then load it into the local image store on the BSUS host. Commands that will do so are as follows:
Before downloading Busybox, on a system with both docker and internet access, check whether the busybox image is already present.
sudo docker image lsIf the Busybox image is not present, continue with the steps below.
Pull the Busybox image from the Docker Hub website:
sudo docker pull busyboxSave the Busybox image as a tar file:
sudo docker save --output busybox.tar busybox(Optional) Clean up the folder by removing the downloaded busybox image. This is useful if you're testing this process on a separate machine.
sudo docker image rm busyboxCopy the tar file to the BSUS host.
Load the tar file into docker:
sudo docker load --input busybox.tarConfirm that the Busybox image is present:
sudo docker image lsTip: Look for a line that lists the Busybox image, with a creation date of today and a size of approximately 4.26 MB.
Backing up BSUS data with the data_backup_restore.py
script
When backing up BSUS data, you'll send the backup command to the
data_backup_restore.py script. The script will create a GZIP
compressed tar archive file (a tgz file). You can either run the script manually, or
execute it as part of an automated process. If desired, you can specify a name and
path for the backup file.
To create a backup with a default name for the backup file:
Run the following command:
python3 data_backup_restore.py backup
To create a backup with a specific name for the backup file:
Run the following command:
python3 data_backup_restore.py backup -f="<path and filename>"The script will automatically append the file name extension
.tgzto your filename. For example, if the path and filename are/home/ubuntu/Downloads/mybackup, the script will create a file namedmybackup.tgzin the/home/ubuntu/Downloads/folder.
Restoring up BSUS data with the data_backup_restore.py
script
When restoring backed up data, you'll send the restore command to
the data_backup_restore.py script.
To restore jobs from a backup file:
Run the following command:
python3 data_backup_restore.py restore -f="<path and filename>