Last active
August 29, 2015 14:02
-
-
Save SebastienElet/6c2de6e3f85ef5e22c74 to your computer and use it in GitHub Desktop.
redis-backup.sh
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 | |
BACKUP=/home/backups/redis | |
REDIS_SOURCE=/var/lib/redis/dump.rdb | |
REDIS_DEST=$BACKUP/$(date +"%Y-%m-%d")-dump.rdb | |
find $BACKUP/* -name "*.rdb" -mtime +7 -exec rm {} \; | |
redis-cli save > /dev/null | |
cp $REDIS_SOURCE $REDIS_DEST |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment