Skip to content

Instantly share code, notes, and snippets.

@nartoan
Created December 5, 2021 14:28
Show Gist options
  • Select an option

  • Save nartoan/73091c86edb5c2f59d8d1869c31dd30a to your computer and use it in GitHub Desktop.

Select an option

Save nartoan/73091c86edb5c2f59d8d1869c31dd30a to your computer and use it in GitHub Desktop.
#!/bin/bash
MY_MONTH =$1
if [[ $MY_MONTH == [0-9][0-9][0-9][0-9][0-1][0-9] ]]
then
redis-cli -h 10.120.53.56 -p 8005 --scan --pattern "ut.game.key.number.turn.daily:*:${MY_DATE}*:*" | xargs redis-cli -h 10.120.53.56 -p 8005 DEL
redis-cli -h 10.120.53.56 -p 8005 --scan --pattern "ut.game.key.gift.total.received.by.date:*:${MY_DATE}*:*" | xargs redis-cli -h 10.120.53.56 -p 8005 DEL
redis-cli -h 10.120.53.56 -p 8005 --scan --pattern "ut.game.key.gift.total.daily.by.date:*:*:${MY_DATE}*" | xargs redis-cli -h 10.120.53.56 -p 8005 DEL
redis-cli -h 10.120.53.56 -p 8005 --scan --pattern "ut.game.key.gift.received.total.daily:*:*:${MY_DATE}*" | xargs redis-cli -h 10.120.53.56 -p 8005 DEL
redis-cli -h 10.120.53.56 -p 8005 --scan --pattern "ut.game.key.gift.total:*:*:${$(($MY_DATE-1))}" | xargs redis-cli -h 10.120.53.56 -p 8005 DEL
redis-cli -h 10.120.53.56 -p 8005 --scan --pattern "ut.game.key.gift.received.total:*:*:${$(($MY_DATE-1))}" | xargs redis-cli -h 10.120.53.56 -p 8005 DEL
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment