Skip to main content

System Backup and Restore

InSystem thisBackup sectionand willSystem 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 ablemoved/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 runit manually to ensure proper operation before scheduling it. The backups can be stored to a 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 oneits orbehavior.

more
    scheduled
  • 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 jobsto forstore yourall Hermesbackups SEG.in Backupsthe jobs/mnt/backups path.
  • The -E flag sets the recipient to send backup success/failure notifications. For example, -E 'recipient@domain.tld' configures the backup to send notifications to recipient@domain.tld.
  • The -F flag sets the sender where the backup success/failure notifications would come from. For example, -F ' 'sender@domain.tld' configures the backup to send notications from sender@domain.tld.
  • The -B flag sets the backup mode. The backup mode can be configuredeither tosystem include(backs up all Hermes related files and databases EXCLUDING the systeme-mail configurationarchive), archive (backs up ONLY the e-mail archive) or all (backups all Hermes related files including the databases as well as the storede-mail emailarchive). archive.For However,example, including-B 'system' sets the storedbackup emailmode archiveto inback aup all Hermes related files and databases. 
  • The -R flag sets the MySQL root password that the backup jobwill can take a considerable amount of time to complete, so instead we recommend that backups jobs be run without including the email archive and instead configuring an Email Archive job under System --> Email Archive.

    Hermes SEG uses CIFS (Windows Shares) to store system backups. Shares have to be successfully validated first before Backup Jobs can be saved.

    Validate Share

    By default, when creating a new Backup Job, the Backup Job Create Mode field is automatically set to Validate Share and the Save Backup Job field is disabled. The Save Backup Job field only gets enabled when a share is succesfully validated.

    1. Enter a friendly name under the Backup Job Name field
    2. Enter an IP Address or a FQDN Host name of the server hosting the share under the Server field
    3. Enter the name of the share under the Share Name field
    4. Enter the name of a directory under the share if applicable under the Directory Name field
    5. Select the SMB Version the server hosting the share
    6. Enter domain name under the Domain field
    7. Enter the username who has access to that share under the Username field
    8. Enter the password for the username from Step 6 under the Password field
    9. Enter the Hermes SEG MySQL Root Username (Usually root)
    10. Enter the Hemres SEG MySQL Root Password
    11. Enter a valid email addressneed in order to getback successup or failure notifications fromall the backupHermes jobdatabases. underFor the example, Backup- NotificationR E-mail'supersercretpass'  field
    12. Selectsets the numberMySQL ofroot dayspassword to retainsupersercretpass.
    13. backup
files

Putting underit the Backupall Filetogether, Retention drop-downif field.you Available options are, 7 Days, 14 Days, 21 Days and 28 Days. The system will use the Backup File Retentionwanted to automaticallyrun deletean olderall backupsbackup, soyou thatcan your storage doesn't get filled up

  • Select the backup frequency from the Frequency drop-down field. Available options are Daily, Weekly and Monthly.
  • Enterrun a datecommand for the backupssimilar to startbelow:

    by
    /opt/hermes/scripts/system_backup.sh either-D selecting7 a-P date'/mnt/backups' by-E clicking'to@domain.tld' the-F calendar'from@domain.tld' button-B or'all' by-R manually entering a date in the form of mm/dd/yyyy in the Start Date field.
  • Select a time for the backups to start by selecting a time from the Start Time drop-down field
  • Select either Yes or No in the Include E-mail Archive Data in the Backup Job
  • Click the Submit button to validate the share (Figure 1)
  • 'Somepassword'

    Figure 1

    image-1606131160307.png

    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 the Save Backup Job  option will be enabled under the the Backup Job Create Mode  on top of the page. Select the the Save Backup Job  option and click the the Submit  button to save the job (Figure 3).

    Figure 3

    image-1606130777072.png

    The job will be saved under the the Existing Backup Jobs 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 button   under the the Run  column to run any job immediately (Figure 6)

    Figure 6

    image-1606131255669.png

    1. In the the Confirmation Window, click the the Yes  button (Figure 7). Clicking 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 the Yes  button (Figure 10). Clicking Clicking No, will take you back to the System Backup page.

    Figure 10

    image-1606131435811.png