Last active
April 22, 2020 12:17
-
-
Save stephanustedy/eb1d0c0daf5cc83373513b1f6980be52 to your computer and use it in GitHub Desktop.
Revisions
-
stephanustedy revised this gist
Apr 22, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ # COPY REAL TIME / NEW DATA while true; do exec redis-cli -h [old-endpoint] monitor | sed -u 's/.*]//' | grep -vi "get\|ping" | redis-cli -h [new-endpoint] >> /dev/null; done; # COPY DATA ON REDIS with TTL redis-cli -h [old-endpoint] --scan | while read key; do tempTTL=$(redis-cli -h [old-endpoint] TTL "$key"); ttl=$tempTTL;if [ $tempTTL -lt 0 ]; then ttl=0; fi; redis-cli -h [old-endpoint] --raw DUMP "$key" | head -c -1 |redis-cli -x -h [new-endpoint] RESTORE "$key" $ttl; echo "copied $key $ttl"; done -
stephanustedy revised this gist
Apr 22, 2020 . No changes.There are no files selected for viewing
-
stephanustedy revised this gist
Apr 22, 2020 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ # COPY REAL TIME / NEW DATA while true; do exec redis-cli -h [old-endpoint] monitor | sed -u 's/.*]//' | grep -vi "get\|ping" | redis-cli -h [new-endpoint]; done; # COPY DATA ON REDIS with TTL redis-cli -h [old-endpoint] --scan | while read key; do tempTTL=$(redis-cli -h [old-endpoint] TTL "$key"); ttl=$tempTTL;if [ $tempTTL -lt 0 ]; then ttl=0; fi; redis-cli -h [old-endpoint] --raw DUMP "$key" | head -c -1 |redis-cli -x -h [new-endpoint] RESTORE "$key" $ttl; echo "copied $key $ttl"; done -
stephanustedy created this gist
May 7, 2019 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ # COPY REAL TIME / NEW DATA while true; do exec redis-cli -h [old-endpoint] monitor | sed -u 's/.*]//' | grep -vi "get\|ping" | redis-cli -h [new-endpoint] >> /dev/null; done; # COPY DATA ON REDIS redis-cli -h [old-endpoint] --scan | while read key; do echo "Copying $key"; redis-cli -h [old-endpoint] --raw DUMP "$key" | head -c -1 |redis-cli -x -h [new-endpoint] RESTORE "$key" 0; done >> /dev/null