Last active
July 18, 2016 02:23
-
-
Save meatballhat/70aec77e9f04ff36de1829793e457528 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
#!/usr/bin/env bash | |
set -o errexit | |
if ! docker inspect redis &>/dev/null ; then | |
docker run --name redis -p 6379:6379 -v /tmp:/data -d redis | |
fi | |
REDIS_CLI="redis-cli -h ${DOCKER_IP:-$(docker-machine ip default)}" | |
for saveset in '900 1' '300 10' '30 100' ; do | |
echo "----- $(date -u): CONFIG SET save \"${saveset}\"" | |
$REDIS_CLI CONFIG SET save "${saveset}" | cat | |
$REDIS_CLI CONFIG GET save | cat | |
$REDIS_CLI DEL sesh &>/dev/null || true | |
$REDIS_CLI HSET sesh name notabot${RANDOM} &>/dev/null | |
$REDIS_CLI HSET sesh id ${RANDOM} &>/dev/null | |
$REDIS_CLI HSET sesh notpasswordreally w4lrU5p0t1oN${RANDOM} &>/dev/null | |
echo "----- $(date -u): initial data" | |
$REDIS_CLI HGETALL sesh | cat | |
echo "----- $(date -u): sleeping ${POST_WRITE_SLEEP:-30}" | |
sleep ${POST_WRITE_SLEEP:-30} | |
echo "----- $(date -u): restarting redis container" | |
docker stop redis &>/dev/null | |
docker start redis &>/dev/null | |
echo "----- $(date -u): re-fetching data" | |
$REDIS_CLI HGETALL sesh | cat | |
done |
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
----- Mon Jul 18 02:21:12 UTC 2016: CONFIG SET save "900 1" | |
OK | |
save | |
900 1 | |
----- Mon Jul 18 02:21:12 UTC 2016: initial data | |
name | |
notabot7343 | |
id | |
18653 | |
notpasswordreally | |
w4lrU5p0t1oN19727 | |
----- Mon Jul 18 02:21:12 UTC 2016: sleeping 30 | |
----- Mon Jul 18 02:21:42 UTC 2016: restarting redis container | |
----- Mon Jul 18 02:21:43 UTC 2016: re-fetching data | |
name | |
notabot7343 | |
id | |
18653 | |
notpasswordreally | |
w4lrU5p0t1oN19727 | |
----- Mon Jul 18 02:21:43 UTC 2016: CONFIG SET save "300 10" | |
OK | |
save | |
300 10 | |
----- Mon Jul 18 02:21:43 UTC 2016: initial data | |
name | |
notabot7802 | |
id | |
4221 | |
notpasswordreally | |
w4lrU5p0t1oN11021 | |
----- Mon Jul 18 02:21:43 UTC 2016: sleeping 30 | |
----- Mon Jul 18 02:22:13 UTC 2016: restarting redis container | |
----- Mon Jul 18 02:22:14 UTC 2016: re-fetching data | |
name | |
notabot7802 | |
id | |
4221 | |
notpasswordreally | |
w4lrU5p0t1oN11021 | |
----- Mon Jul 18 02:22:14 UTC 2016: CONFIG SET save "30 100" | |
OK | |
save | |
30 100 | |
----- Mon Jul 18 02:22:14 UTC 2016: initial data | |
name | |
notabot1880 | |
id | |
10451 | |
notpasswordreally | |
w4lrU5p0t1oN15468 | |
----- Mon Jul 18 02:22:14 UTC 2016: sleeping 30 | |
----- Mon Jul 18 02:22:44 UTC 2016: restarting redis container | |
----- Mon Jul 18 02:22:45 UTC 2016: re-fetching data | |
name | |
notabot1880 | |
id | |
10451 | |
notpasswordreally | |
w4lrU5p0t1oN15468 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment