Created
September 27, 2018 05:12
-
-
Save taka3110/efbb97ce54e0902ab8bf74c08acaad70 to your computer and use it in GitHub Desktop.
バックアップをS3に転送する
This file contains 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 characters
#!/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