Bug #71705 Provide example cron entry
Submitted: 13 Feb 2014 14:31 Modified: 12 Jan 2015 14:54
Reporter: Daniël van Eeden (OCA) Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Enterprise Backup Documentation Severity:S3 (Non-critical)
Version:3.9.0 OS:Any
Assigned to: Daniel So CPU Architecture:Any
Tags: Backup, Cron, schedule, task scheduler, usability

[13 Feb 2014 14:31] Daniël van Eeden
Description:
An example cron entry should be given in the documenation.

One example should use /etc/cron.d/mysqlbackup and the other one should the per user crontab format (e.g. crontab -e). The /etc/cron.d/mysqlbackup file can easily be distributed/managed by packages and a config management tool.

The user should be made aware that mysqlbackup by default logs to stderr instead of stdout, so it might be useful to redirect both to /dev/null.

How to repeat:
Search docs for cron

Suggested fix:
Add to docs.
[13 Feb 2014 16:05] MySQL Verification Team
Hello Daniel,

Thank you for the report.

Thanks,
Umesh
[27 Oct 2014 8:25] Daniël van Eeden
Related to MOS Doc ID 1524777.1
https://support.oracle.com/epmos/faces/DocContentDisplay?id=1524777.1
[12 Nov 2014 21:51] Daniel So
Added a new section in the MySQL Enterprise Backup 3.10 and 3.11 manuals titled "Making Scheduled Backups" (http://dev.mysql.com/doc/mysql-enterprise-backup/3.11/en/meb-scheduled-backups.html) to provide some sample crontab entries.

The new section will be available in the next builds of the manuals.
[13 Nov 2014 13:07] Daniël van Eeden
It's a good start, but I don't this is sufficient.

1. This is too Linux specific
- Provide a crontab with "@daily" replaced by the classic minute/hour/day/etc format as understood by all UNIX-like systems (Both System V and BSD)
- Provide a Windows Task scheduler XML file.

2. It should use a config file for common options
- backup-dir and with-timestamp could be placed in the mysqlbackup of my.cnf (or mysqlbackup.cnf and then use --defaults-file=)
- A config file with [mysqlbackup_full] and [mysqlbackup_incremental] could be used to split incremental-only and full-only options. And then use the defaults-group-suffix='_full' and defaults-group-suffix='_incremental'.

3. It should take authentication in account.
- Now '-uroot' is used (better use '-u root'), this only works if there is no password set (which is bad)
- This could work if a password is set in ~/.my.cnf, but this is not documented here or safe.
- The solution should be to use a login-path (But be aware of Bug 19955505)
- Another solution is to use the Socket Peer-Credential Authentication plugin for the backup user
http://dev.mysql.com/doc/refman/5.6/en/socket-authentication-plugin.html

4. Cleanup is not taken in account.
- This is often implemented as a "find $backupdir -mtime +7 -exec rm {} \;" on Linux, but thats risk removing full backups on which more recent incrementals are based.
- A powershell script can be used to remove old backups on windows
- This might not be needed when using cloud backups

5. Incremental backups are not taken in account.
- A very common backup senario is to do weekly full backups and then daily incrementals
- The --incremental-base=history:last_backup option could be used for this
[10 Jan 2015 10:19] Daniël van Eeden
This is not fixed yet...
[12 Jan 2015 14:54] Stefan Hinz
Documenting cron-specific things is not the responsibility of the MySQL documentation team. Daniel So added some information, anyway. For more information, please consult your system's crontab documentation.
[12 Jan 2015 14:55] Stefan Hinz
Posted by developer:
 
Documenting cron-specific things is not the responsibility of the MySQL documentation team. Daniel So added some information, anyway. For more information, please consult your system's crontab documentation.