Scheduling#
Any CLI command can be scheduled to run automatically, including but not restricted to backups and security upgrades.
By default there is no backup maintenance scheduled. Backup maintenance can be scheduled with the number of copies to be kept - refer to the backup maintenance topic.
Note
Scheduled commands will not run while the system is in maintenance mode. See System Maintenance Mode in the Platform Guide.
The automated job schedule format is as follows:
schedule add <job-name> <user-command>
schedule time <job-name> <hour> <minute>
schedule time <job-name> every <N> hours
Alternatively the job can be scheduled to run every week on Monday with schedule time <job-name> weekly 1; where 0 is Sunday, 1 is Monday, 2 is Tuesday, 3 is Wednesday, 4 is Thursday, 5 is Friday and 6 is Saturday
schedule enable <job-name>
Example:
schedule add mybackups backup create localbackup
schedule time mybackups 2 0
schedule time mybackups weekly 0
schedule enable mybackups
Among the tasks that can be scheduled are:
Backup creation, e.g. schedule add backupme backup create localbackup
Backup maintenance, e.g. schedule add backupclean backup clean localbackup keep 5
Health reports, e.g. schedule add reports diag report
The example below shows the console output for some commands:
platform@host:~$ schedule add myexport voss export type license_initial_audit
Automatically setting time to midnight and enabling
myexport:
active: true
command: voss export type license_initial_audit --force
hour: 0
min: 0
platform@host:~$ schedule time myexport weekly 0
myexport:
active: true
command: voss export type license_initial_audit --force
hour: 0
min: 0
week: 0
platform@host:~$ schedule disable myexport
myexport:
active: false
command: voss export type license_initial_audit --force
hour: 0
min: 0
week: 0
Note
If a schedule is in a state where the last executed and next execution time are equal, then the next execution time will be recalculated to ensure its execution.