Last active
June 8, 2016 04:42
-
-
Save moznion/1f5b5583f64f997876b15d930a0c8702 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ADJUST="10" | |
DB_NAME="your_table" | |
DUMP_LOCATION="/tmp" | |
cd ${DUMP_LOCATION} || exit 0 | |
mysqldump -uroot ${DB_NAME} > $(date "+%Y%m%d").dump | |
nice -n ${ADJUST} find . -mtime +5 -path "2*.dump" -exec rm -f {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment