Skip to content

Instantly share code, notes, and snippets.

@taka3110
Created September 27, 2018 05:12
Show Gist options
  • Save taka3110/efbb97ce54e0902ab8bf74c08acaad70 to your computer and use it in GitHub Desktop.
Save taka3110/efbb97ce54e0902ab8bf74c08acaad70 to your computer and use it in GitHub Desktop.
バックアップをS3に転送する
#!/bin/bash
# Description: 当日のバックアップをs3に送るするだけのシェル
# 削除はS3のライフサイクルで実施。
#
########################
###### Base info
########################
BACKUPDIR=/your/path
# 通知用(メール通知が必要であればこちらに記入)
#MAILTO="[email protected]"
########################
/usr/bin/aws s3 cp $BACKUPDIR/backupfile s3:///path
#失敗通知が必要であればMAILTOを設定してここを有効化
#case "$?" in
# "0" );;
# * ) echo "Failed to S3 upload. `/bin/date`. Please check by yourself." |mail -s "S3backup Failed to S3 upload" $MAILTO
# exit 255;;
#esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment