Skip to main content

System Backup and Restore

System Backup and System Restore are configured and ran in the CLI as root. There is a Backup script located at /opt/hermes/scripts/system_backup.sh and a Restore script located at /opt/hermes/scripts/system_restore.sh. These scripts should not be moved/copied to other locations. System Backups should be scheduled via Cron other other mechanism to point to  /opt/hermes/scripts/system_backup.sh.

Before scheduling system_backup.sh, it's highly recommended that you run it manually to ensure proper operation before scheduling it. The backups can be stored to any mount that you have previously configured in your system such as SMB, NFS etc...

System Backup

The /opt/hermes/scripts/system_backup.sh script accepts several flags with corresponding values enclosed in single quotes in order to configure its behavior.

  • The -D flag sets the number of days of backups to retain. For example, -D '7' would configure it to delete any backups older than 7 days.
  • The -P flag sets the path to store the backups WITHOUT the trailing slash. For example -P '/mnt/backups' configures the backup to store all backups in the /mnt/backups path.
  • The -E flag sets the recipient to send backup success/failure notifications. For example, -E 'to@domain.tld' configures the backup to send notifications to to@domain.tld.
  • The -F flag sets the sender where the backup success/failure notifications would come from. For example, -F ' 'from@domain.tld' configures the backup to send notications from from@domain.tld.
  • The -B flag sets the backup mode. The backup mode can be either system (backs up all Hermes related files and databases EXCLUDING the e-mail archive), archive (backs up ONLY the e-mail archive) or all (backups all Hermes related files including the databases as well as the e-mail archive). For example, -B 'system' sets the backup mode to back up all Hermes related files and databases. 
  • The -R flag sets the MySQL root password that the backup will need in order to back up all the Hermes databases. For example, - R 'supersercretpass' sets the MySQL root password to supersercretpass.

Putting it all together, if you wanted to run an all backup, you can run a command similar to below:

/opt/hermes/scripts/system_backup.sh -D '7' -P '/mnt/backups' -E 'to@domain.tld' -F 'from@domain.tld' -B 'all' -R 'supersercretpass'

Please note, that running an all backup will create two separate backup files in the backup location. One backup file will be for the system backup and the other backup files will be for the archive backup.

Share Validation Successful

If the validation is succesful, you will receive the following message (Figure 2)

Figure 2

image-1606130486402.png

You will also notice that the Save Backup Job option will be enabled under the Backup Job Create Mode on top of the page. Select the Save Backup Job option and click the Submit button to save the job (Figure 3).

Figure 3

image-1606130777072.png

The job will be saved under the Existing Backup Jobs section on the bottom of the page (Figure 4)

Figure 4

image-1606131233561.png

Share Validation Unsuccessful

If the validation is unsuccesful, you will receive the following message (Figure 5).

Figure 5

image-1606131243490.png

Check the information supplied and share permissions and try validating the share again.

Manually Run Backup Job

Note: Only one Backup Job can be run at a time.

Any saved backup jobs will run according to the schedule you set. Alternatively if you wish to run a job immediately:

  1. Click on the green arrow button  under the Run column to run any job immediately (Figure 6)

Figure 6

image-1606131255669.png

  1. In the Confirmation Window, click the Yes button (Figure 7). Clicking No, will take you back to the System Backup page.

Figure 7

image-1606131265577.png

If a Backup Job is in progress, the button under the Run column of every Backup Job will become disabled (Figure 8)

Figure 8

image-1606131275573.png

Delete Backup Job

If you wish to delete an existing Backup Job and the job is NOT running:

  1. Click on the red X  under the Delete column (Figure 9)

Figure 9

image-1606131395501.png

  1. In the Confirmation Window, click the Yes button (Figure 10). Clicking No, will take you back to the System Backup page.

Figure 10

image-1606131435811.png