Created
April 10, 2018 15:39
-
-
Save lovellfelix/efd233e08a77145fc5e3ddade81d29c8 to your computer and use it in GitHub Desktop.
Revisions
-
lovellfelix created this gist
Apr 10, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ #!/bin/sh # variables for vault name, timestamp, and output file VAULT="sandbox-02" NOW=$(date +%s) IDFILE="archive-ids-${NOW}.json" # make sure we can write the output file touch $IDFILE || exit 1 # upload all tar files in forbackup directory, writing # results to the output file # # the archive-description string in the filename prefixed # with the timestamp. this information may be of great # help when/if we later retrieve the file. for F in /home/myproject/forbackup/*.tar; do echo "# $F" >> $IDFILE aws glacier upload-archive \ --vault-name "$VAULT" \ --account-id - \ --archive-description "${NOW}/$F" \ --body "$F" >> $IDFILE done