123456789101112 |
- #!/bin/bash
- suffix=$(date -d 'today' +%Y-%m-%dT%H:%M)
- tmpdir=$(mktemp -d)
- dumpfile="dump-$suffix.rdb"
- echo "Transeferring RDB file"
- # 56379 is the port of the service, in case redis is running on a different server
- # by passing --rdb, we are creating 'dump.rdb' on the local filesystem.
- redis-cli -h redis -p 56379 --rdb dump.rdb
- echo "Sending backup to ${BCK_USERNAME}@${BCK_HOSTNAME}"
- scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null dump.rdb "$BCK_USERNAME"@"$BCK_HOSTNAME":"$BCK_FOLDER"/"$dumpfile"
|