Include the backup commands (data_backupand/or config_mirror) in the table for scheduled commands on MX-ONE Service Node 1, crontab, to activate automatic backup of the MX-ONE system.
crontab uses the editor specified by certain environment variables. Use the command man crontab to find out which environment variables. To check the environment variables, use the command echo $variablename. If the editor is unfamiliar, it is possible to change it.
For more information, such as the format of the crontab command, see the online reference manual pages for crontab. Use the command man 5 crontab.
Use MX-ONE Service Node Administrator user (mxone_admin) when executing the crontab command.
Enter the command crontab -e to open an editor.
Add lines containing when to run scheduled commands. The first 5 fields specify when to run the command and the remaining field what command to run (see examples below). It is recommended to allow at least 30 minutes between the different jobs.
The fields must be separated by at least one space. Use a header line (starting with #) to make the information easier to read.
Save the file and close the editor. Crontab installs the new table for scheduled commands.
Make a data backup on every night at 01:30.
min | hour | day | month | weekday | command |
---|---|---|---|---|---|
30 | 01 | * | * | * | /opt/eri_sn/bin/mdsh -c data_backup |
Example 2:
Make a data backup on every night at 01:30 and generate an alarm if data backup fails.
min | hour | day | month | weekday | command |
---|---|---|---|---|---|
30 | 01 | * | * | * | /opt/eri_sn/bin/mdsh -c data_backup ; if [ $? != 0 ] ; then /opt/eri_sn/bin/alarm -i -C 1 -D 10000 --alarm-severity 3 --alarm-text "Automatic data backup failed" ; fi |
Example 3:
Make a data backup on every Thursday night (4th day of week) and Sunday night (7th day of week) at 00:45.
min | hour | day | month | weekday | command |
---|---|---|---|---|---|
45 | 00 | * | * | 4,7 | /opt/eri_sn/bin/mdsh -c data_backup |
Example 4:
Make a data backup every Monday (1st day of week) and Friday (5th day of week) at 22:00. Create a configuration mirror including a data backup every Friday at 23:00.
min | hour | day | month | weekday | command |
---|---|---|---|---|---|
00 | 22 | * | * | 1,5 | /opt/eri_sn/bin/mdsh -c data_backup |
00 | 23 | * | * | 5 | /opt/mxone_install/bin/config_mirror --databackup |
Example 5:
Make a data backup on every night at 02:00. Create a configuration mirror including a data backup and safety backup on every Sunday night (7th day of week) at 02:30.
min | hour | day | month | weekday | command |
---|---|---|---|---|---|
00 | 02 | * | * | * | /opt/eri_sn/bin/mdsh -c data_backup |
30 | 02 | * | * | 7 | /opt/eri_sn/bin/config_mirror --databackup --safetybackup |
Enter the command crontab -e to open an editor.
Update the lines specifying when the commands are scheduled with new time and date.
Save the file and close the editor. Crontab installs the new table for scheduled commands.
Enter the command crontab -e to open an editor.
Remove the lines containing scheduling of commands.
Save the file and close the editor. Crontab installs the new table for scheduled commands.