The backup process backs up the entire SAFR Server, including the various databases, configuration files, images, and objects, to a single backup file at a location of your choosing. The restore process restores all the SAFR Server data to any computer that meets the minimum system requirements. Note that the target computer of the restore process doesn't need to have the same IP address as the original computer.
Both the backup and restore commands have some useful optional arguments that you can use when invoking the commands.
Open a command line console with administrative privileges.
command path: C:\Program Files\RealNetworks\SAFR\bin
run command: python backup.py
The backup command generates a backup file at the path C:\Program Files\RealNetworks\SAFR-backups\SAFR-backup-YYYYMMDD-HHMMSS.tgz
Open a command line console with administrative privileges.
command path: C:\Program Files\RealNetworks\SAFR\bin
run command: python restore.py BACKUPFILENAME
python restore.py "C:\Program Files\RealNetworks\SAFR-backups\SAFR-backup-20190814-003342.tgz"
Press Y when asked, "Are you sure? (Yy/Nn)"
You'll receive the following message when the restore is complete:
SAFR Restore Complete.
To use the Windows Task Scheduler to create a daily database backup, do the following:
Run the Windows Task Scheduler as an administrator. The Task Scheduler window will be displayed.
In the Actions pane, click Create Basic Task.
In the wizard's Name field, provide a name for the task. (e.g. SAFR DB Daily Backup) Click Next.
Under Task Trigger, select the Daily option, and click Next.
Set the date and time for when you want the task to run, and enter 1 in the Recur field. Click Next.
Using a text editor, create a .bat file called SAFR DB Daily Backup. Edit the .bat file, add the following commands, and then save the file.
@echo off
cd C:\Program Files\RealNetworks\SAFR\bin
start python backup.py
Under Action, select the Start a Program option, and click Next.
Click Browse and select the SAFR DB Daily Backup.bat file you created in Step 6. Click Next.
Under Summary, select Open the Properties dialog for this task when I click Finish, and click Finish.
In Properties, do the following:
Once this procedure is completed, you can find the task in the Task Scheduler Library. Check History to view the task events. You can find the daily backup file in the path shown in the SAFR DB Daily Backup.bat file.
command path: /opt/RealNetworks/SAFR/bin
run command: sudo python backup.py
The backup command generates a backup file at the path /opt/RealNetworks/SAFR-backups/SAFR-backup-YYYYMMDD-HHMMSS.tgz
You'll receive the following message when the backup is complete:
Backup File: /opt/RealNetworks/SAFR-backups/SAFR-backup-20190814-003342.tgz SAFR Backup Complete.
command path: /opt/RealNetworks/SAFR/bin
run command: sudo python restore.py BACKUPFILENAME
sudo python restore.py /opt/RealNetworks/SAFR-backups/SAFR-backup-20190814-083700.tgz
Press Y when asked, "Are you sure? (Yy/Nn)"
Script:
#backup at 1 a.m every day
0 1 * * * /bin/sh /opt/RealNetworks/SAFR/bin/backup
# remove 7 days before backup files at each sunday 0:30 a.m
30 0 * * 0 find /opt/RealNetworks/SAFR-backups/ -mtime +3 -name "*.tgz" -exec rm -rf {} \;
Result:
root@SAFRDemo:/opt/RealNetworks/SAFR/backups# ls -l
total 6547396
-rw-r----- 1 safr safr 837380012 Sep 11 01:00 SAFR-backup-20190911-010001.tgz
-rw-r----- 1 safr safr 837423761 Sep 12 01:00 SAFR-backup-20190912-010001.tgz
-rw-r----- 1 safr safr 837443430 Sep 13 01:00 SAFR-backup-20190913-010001.tgz
-rw-r----- 1 safr safr 837450675 Sep 14 01:00 SAFR-backup-20190914-010001.tgz
-rw-r----- 1 safr safr 837588424 Sep 15 01:00 SAFR-backup-20190915-010001.tgz
-rw-r----- 1 safr safr 837587472 Sep 16 01:00 SAFR-backup-20190916-010001.tgz
-rw-r----- 1 safr safr 839439035 Sep 17 01:00 SAFR-backup-20190917-010001.tgz
command path: /Library/RealNetworks/SAFR/bin
run command: sudo python backup.py
The backup command generates a backup file at the path /opt/RealNetworks/SAFR-backups/SAFR-backup-YYYYMMDD-HHMMSS.tgz
You'll receive the following message when the backup is complete:
Backup File: /Library/RealNetworks/SAFR-backups/SAFR-backup-20190814-003342.tgz SAFR Backup Complete.
command path: /Library/RealNetworks/SAFR/bin
run command: sudo python restore.py BACKUPFILENAME
sudo python restore.py /opt/RealNetworks/SAFR-backups/SAFR-backup-20190814-083700.tgz
Press Y when asked, "Are you sure? (Yy/Nn)"
You'll receive the following message when the restore is complete:
SAFR Restore Complete.
The backup and restore process should only be run on the Primary Server of a SAFR Server cluster. Data restored on the primary will automatically be synchronized to the SAFR Secondary Servers after the SAFR Primary Server is restored.
To restore a SAFR Server cluster,