redis-upload.sh 624 B

12345678910111213141516171819202122
  1. #!/bin/bash
  2. source $HOME/.bash_profile
  3. PATH=$PATH:/usr/local/bin
  4. cd /etc/golti/registrations
  5. git pull
  6. #redis-cli -h empire -n 7 -x SET httpscanvasinstructurecom-32990000000000049 < httpscanvasinstructurecom-32990000000000049.json
  7. #redis-cli -h empire -n 7 EXPIRE httpscanvasinstructurecom-32990000000000049 60 > /dev/null 2&>1
  8. redishost=empire
  9. redisdb=7
  10. redistimeout=600
  11. for file in *\.json; do
  12. f=$(echo "$file" | cut -f 1 -d '.')
  13. redis-cli -h $redishost -n $redisdb -x SET $f < $file > /dev/null 2>&1
  14. redis-cli -h $redishost -n $redisdb EXPIRE $f $redistimeout > /dev/null 2>&1
  15. echo "Uploaded $f";
  16. done