-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
#!/usr/bin/env bash # https://www.shellcheck.net/ VERIFIED set -e set -E set -o pipefail set -u # set -x log="/tmp/error.txt" exec 2>>"$log" handle_error() { # ...handle error exit 1 } handle_exit() { # ...handle exit exit 0 } trap 'handle_exit $?' EXIT trap 'handle_error $?' ERR bucket='something-something' container_name="my_redis_container" dump_file_directory="/tmp" host="localhost" port="6379" dump_file_name=$(aws s3 ls $bucket --recursive | sort | tail -n 1 | awk '{print $4}') aws s3 cp "s3://${bucket}/${dump_file_name}" "/tmp/${dump_file_name}" docker ps -aq --filter "name=${container_name}" | grep -q . && docker stop "${container_name}" && docker rm -fv "${container_name}" docker run --detach --name "${container_name}" --publish "${port}:${port}" --volume "/tmp/${dump_file_name}:/data/dump.rdb" redis # Wait for the Docker container to be ready until docker exec -it "${container_name}" redis-cli -h "${host}" -p "${port}" ping; do sleep 1 done # HOW TO VERIFY IF REDIS WAS RESTORED SUCCESSFULLY HERE???