Skip to content

Instantly share code, notes, and snippets.

@denismakogon
Created August 4, 2014 12:55
Show Gist options
  • Save denismakogon/8036ea2e11194c0e30f2 to your computer and use it in GitHub Desktop.
Save denismakogon/8036ea2e11194c0e30f2 to your computer and use it in GitHub Desktop.
#!/bin/bash
rediscli=`which redis-cli`
lsave=`$rediscli lastsave`
echo "LASTSAVE $lsave"
saved="`$rediscli config get dir | xargs | cut -d ' ' -f 2`/`$rediscli config get dbfilename | xargs | cut -d ' ' -f 2`"
$rediscli bgsave
while [ $lsave -eq `$rediscli lastsave` ]; do
sleep 5
done
echo "LASTSAVE `$rediscli lastsave`"
echo "BGSAVE complete! ($saved)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment