Skip to content
Snippets Groups Projects
Commit 5ae803a9 authored by ayushsharma's avatar ayushsharma
Browse files

Changing random string generation command for Ubuntu 16.04.

Removing extra / from S3 cp command which was causing creation of empty folder in bucket.
parent 5e535442
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,7 @@
# Initialize things
target_bucket=$1
timestamp=`date +"%s_%d-%B-%Y_%A@%H%M"`
backup_tmp="/tmp/"`cat /dev/random | tr -dc "[:alpha:]" | head -c 8`
backup_tmp="/tmp/"`< /dev/urandom tr -dc "[:alnum:]" | head -c10`
backup_tar_file="influxdb_backup_$timestamp.tar.gz"
backup_tar_path="/tmp/"
......@@ -45,7 +45,7 @@ tar cvzf $backup_tar_path$backup_tar_file .
# Upload
echo `date +"%d-%B-%Y@%H:%M:%S"`" - Uploading $backup_tar_path$backup_tar_file to $target_bucket/$backup_tar_file."
aws s3 cp $backup_tar_path$backup_tar_file $target_bucket/$backup_tar_file
aws s3 cp $backup_tar_path$backup_tar_file $target_bucket$backup_tar_file
# Cleanup
echo `date +"%d-%B-%Y@%H:%M:%S"`" - Cleaning up."
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment