Quantcast
Channel: Tutorials — LowEndTalk
Viewing all articles
Browse latest Browse all 368

Backup a MySQL db with logrotate

$
0
0

File: /etc/logrotate.d/mydb-backup.conf

/home/sleddog/mydb/dump.sql {
    daily
    rotate 14
    compress
    nocreate
    postrotate
        /usr/bin/mysqldump my_db > /home/sleddog/mydb/dump.sql || true
    endscript
}

Now rsync the dir to a remote location for geographic redundancy :)


Viewing all articles
Browse latest Browse all 368

Trending Articles