From Gamboge Dolphin, 5 Years ago, written in Bash.
Embed
  1. #!/bin/bash
  2.  
  3. for a in `seq 8 -1 0`; do
  4.         mv /var/backups/mysql/mysqldump.sql.$a.bz2 /var/backups/mysql/mysqldump.sql.$[a+1].bz2
  5. done
  6.  
  7. /usr/bin/mysqldump --events --all-databases > /var/backups/mysql/mysqldump.sql.0
  8. /bin/bzip2 -9 /var/backups/mysql/mysqldump.sql.0

Replies to Keep 10 copies of sql db dumps rss

Title Name Language When
Re: Keep 10 copies of sql db dumps Blush Porcupine bash 5 Years ago.