redis-upload.sh 615 B

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