0
Is there any best practice for saving mysql-dumps daily backups for 30 days and then delete them, without writing scripts that checks date and delete?
maybe a builtin tool?
0
Is there any best practice for saving mysql-dumps daily backups for 30 days and then delete them, without writing scripts that checks date and delete?
maybe a builtin tool?
0
You can use logrotate
for that. A sample logrotate configfile could look something like this, assuming that you use a cronjob to save a daily mysql-dump in /home/myuser/mysqldumps/mydb.sql
:
/home/myuser/mysqldumps/mydb.sql {
daily
missingok
rotate 31
notifempty
}
Adding compress
can be considered to reduce diskspace.