Skip to content

A short extension for automysqlbackup, allowing to perform hourly backups.

License

Notifications You must be signed in to change notification settings

mojo-it/automysqlbackup_hourly

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

automysqlbackup_hourly

This script is an extension of automysqlbackup, to support hourly backups of MySQL databases.

Compatibility

Debian and Ubuntu only. Tested with Debian 10 (Buster) and Ubuntu 20.04 (Focal).

Installation

First, automysqlbackup must be installed :

sudo apt-get install automysqlbackup

The automysqlbackup_hourly script can be copied or linked into /etc/cron.hourly/ :

sudo ln -s automysqlbackup_hourly /etc/cron.hourly/

For testing it, just launch as root :

./automysqlbackup_hourly

Then, in your backup's directory, you will see :

hourly daily weekly monthly

Every hour, you'll have a new dump for each database in hourly directory.

How it works

Every hour, it takes the last dump present in your daily or weekly directory (depending on the day given by DOWEEKLY parameter), and copy it to the hourly/yourdb directory. Then, it launches the automysqlbackup script to create a new dump in daily or weekly directory. Finally, dumps older than 7 days in hourly directory are deleted. You can change the number of days by changing ROTATION_DAYS variable, at the beginning of the script.

About

A short extension for automysqlbackup, allowing to perform hourly backups.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 95.3%
  • Dockerfile 4.7%