Mysql-zrm-scheduler: Difference between revisions
(→NAME) |
|||
Line 16: | Line 16: | ||
== DESCRIPTION == | == DESCRIPTION == | ||
''mysql-zrm-scheduler'' is the utility for ZRM for MySQL used to schedule MySQL backups using [[mysql-zrm]](1). | |||
At the scheduled time, this | At the scheduled time, this utility will first execute the optional pre-scheduler plugin (see [[#Pre-Scheduler|Pre-Scheduler]] section) to determine the system load before running the backup. Otherwise, it will directly run the backup. | ||
mysql-zrm-scheduler | ''mysql-zrm-scheduler'' also implements the backup retention policy and purges [[mysql-zrm]] backup files. By default, the backup image purge action will be performed at 4:00am daily. See mysql-zrm [[Mysql-zrm#OPTIONS|retention-policy]] parameter for details. | ||
When ''--now'' option is specified, the mysql-zrm-scheduler utility will run [[mysql-zrm]] immediately. | |||
== OPTIONS == | == OPTIONS == |
Revision as of 02:38, 30 November 2006
NAME
mysql-zrm-scheduler - backup scheduler utility for ZRM for MySQL
SYNOPSIS
mysql-zrm-scheduler --add|--query|--delete|--now [--start-time <start time>] [--day-of-week <day of week>] [--day-of-month <day of month>] [--interval <interval>] [--backup-level <0|1>] [--backup-set <backupset name>] [--help]
DESCRIPTION
mysql-zrm-scheduler is the utility for ZRM for MySQL used to schedule MySQL backups using mysql-zrm(1).
At the scheduled time, this utility will first execute the optional pre-scheduler plugin (see Pre-Scheduler section) to determine the system load before running the backup. Otherwise, it will directly run the backup.
mysql-zrm-scheduler also implements the backup retention policy and purges mysql-zrm backup files. By default, the backup image purge action will be performed at 4:00am daily. See mysql-zrm retention-policy parameter for details.
When --now option is specified, the mysql-zrm-scheduler utility will run mysql-zrm immediately.
OPTIONS
- --add
- Add a mysql-zrm backup run to the schedule based on the time specified by other options.
- --delete
- Delete a scheduled backup run. To delete a scheduled run with specific timestamp, add --start option.
- --query
- Displays list of backup runs scheduled.
- --interval <interval>
- Valid inputs are daily, weekly or monthly.
- --now
- Does MySQL backup now.
- --backup-set <name>
- Specify the backup set for the backup run. Default is BackupSet1.
- --backup-level <0|1>
- If 0 is specified, then a full backup is done. If 1 is specified, an incremental backup is done. Default is 0.
- --start <start time>
- start time for the backup run in HH:MM format. Default value is 00:00 for monthly, 02:00 for weekly and 03:00 for daily interval.
- --day-of-week <day of week>
- Single number from 0-6 (0=Sunday, 6=Saturday), or a range of two numbers separated with a hyphen. This value is used with weekly interval. Example: 1, to start on Monday 0-2, to start on Sunday, Monday and Tuesday. Default 0 (Sunday).
- --day-of-month <day of month>
- Single number from 1-31 or a range of two numbers separated with a hyphen. This value is used with monthly interval. Example: 2, to start on second day of the month. 10-12, to start on the 10th, 11th and 12th day of the month. Default 1 (first day of the month).
- --help
- Display help message and exit.
Pre-Scheduler
The mysql-zrm-scheduler tool calls the pre-scheduler plugin before
the scheduled MySQL backup run. The plugin can ask the scheduler to
skip the backup run or delay the start of the backup run. The plugin
should return "0" to instruct this tool to perform MySQL backup run
immediately. Return "n" where n is a positive integer smaller or equal
to 11 to instruct this tool to delay the MySQL backup run by "n"
hour(s) from the current time. Returning any number greater than "11"
would skip the scheduled MySQL backup run.
mysql-zrm-scheduler tool will skip the daily backup run if the pre-scheduler plugin could not find a suitable time ( have not returned value "0" ) in 24 hours (from the initial scheduled start time). For weekly or monthly backup run, mysql-zrm-scheduler will perform a backup run at the end of the 24 hours (from the intial scheduled start time) even if pre-scheduler plugin have not found a
suitable time in the 24 hours cycle.
The pre-scheduler plugin is specified in mysql-zrm.conf(5).
EXAMPLES
To schedule a daily mysql-zrm run to start at 1:35pm:
# mysql-zrm-scheduler --add --interval daily --start 13:35
To schedule a weekly mysql-zrm run to start on Tuesday and Wednesday:
# mysql-zrm-scheduler --add --interval weekly --day-of-week 2-3
To schedule a monthly mysql-zrm run to start on the tenth day of each month:
# mysql-zrm-scheduler --add --interval monthly --day-of-month 10
To query mysql-zrm scheduled runs:
# mysql-zrm-scheduler --query 35 13 * * * /usr/bin/zrm-pre-scheduler --action backup --backup-set BackupSet1 --interval daily 0 2 * * 2-3 /usr/bin/zrm-pre-scheduler --action backup --backup-set BackupSet1 --interval weekly 0 0 10 * * /usr/bin/zrm-pre-scheduler --action backup --backup-set BackupSet1 --interval monthly
To delete a daily mysql-zrm run which has specific start time from schedule:
# mysql-zrm-scheduler --delete --interval daily --start 13:35
To delete the weekly mysql-zrm run from schedule:
# mysql-zrm-scheduler --delete --interval weekly --day-of-week 2-3
FILES
- /var/lib/mysql-zrm
- Directory under which all backup data is stored.
- /etc/mysql-zrm/<backup set name>/mysql-zrm.conf
- Configuration file read by mysql-zrm tool.
RETURN VALUES
On success, zero is returned. On error, non-zero value is returned.
SEE ALSO
mysql-zrm(1), mysql-zrm.conf(5), mysql-zrm-reporter(1), mysql(1), Zmanda Recovery Manager for MySQL.
AUTHOR
Zmanda Inc. (http://www.zmanda.com)