MySQL backup CGI script question

4 posts / 0 new
Last post
#1 Mon, 11/06/2017 - 02:09
hany

MySQL backup CGI script question

Hello Everyone; Script file: /usr/libexec/webmin/mysql/backup_db.cgi working just find and do all job needed, but can it modified to backup all databases in more then one version. I made it scheduled hourly and when it run every hour it over wright the existing, i need to backup hourly with more then one version say add $(date +%F) = YYYY-MM-DD if it possible. Regards

Mon, 11/06/2017 - 02:37
noisemarine
Mon, 11/06/2017 - 05:36
hany

Hello noisemarine, Thanks for this one, actually since i need it to backup databases every hour i have modified the DATE variable to be: date +%F-%H EX: (2017-11-01-11). This assuming will create 24 folders per day (1 folder per hour). Now i need a script that takes a backup of a new week and remove the backup of the previous week. EX: New backup will be taken from day 8 to day 14, and old backup will be removed (from day 1 to day 7) and so on. Thanks

Tue, 11/07/2017 - 00:56
hany

i have mange it by adding this: find /backup/path -maxdepth 1 -type d -mtime +7 -exec rm -rf {} \;

Topic locked