Mysql-zrm-scheduler

From wiki.zmanda.com
Revision as of 03:02, 30 November 2006 by Paddy (talk | contribs) (→‎OPTIONS)
Jump to navigation Jump to search

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 to run on the time specified by other options.
--delete
Delete a scheduled backup run. Use --start option to delete a scheduled run with specific time.
--query
Displays a list of backup runs scheduled.
--interval <interval>
Valid options are daily, weekly or monthly.
--now
Immediately do the backup of MySQL.
--backup-set <name>
Specify the backup set name for the backup run. Default is BackupSet1.
--backup-level <0|1>
Choose 0 for full backup. Choose 1 for an incremental backup. Default is 0.
--start <start time>
Start time for the backup run in HH:MM format. Default values are 00:00 for monthly, 02:00 for weekly and 03:00 for daily intervals.
--day-of-week <day of week>
Value used with weekly interval to specify the day(s) of week. Use a single number from 0-6 (0=Sunday, 6=Saturday), or a range of two numbers separated with a hyphen. Example: 1, to start on Monday 0-2, to start on Sunday, Monday and Tuesday. Default value is 0 (Sunday).
--day-of-month <day of month>
Value used with monthly interval to specify the day(s) of month. Use a single number from 1-31 or a range of two numbers separated with a hyphen. 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 value is 1 (first day of the month).
--help
Display help message and exits.

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)