This commit is contained in:
@@ -60,6 +60,7 @@ rm ~/$BACKUP_FILENAME
|
||||
|
||||
echo "uploading"
|
||||
if [ "$USE_SFTP" -eq 1 ]; then
|
||||
echo "use sftp"
|
||||
cd ~/
|
||||
sshpass -e sftp -oBatchMode=no ${SFTP_EXTRA} -b - ${SFTP_USER}@${SFTP_HOST} << !
|
||||
cd ${SFTP_PATH}
|
||||
@@ -68,7 +69,7 @@ if [ "$USE_SFTP" -eq 1 ]; then
|
||||
!
|
||||
if [ "$month_day" -eq 1 ] ; then
|
||||
echo "make monthly backup"
|
||||
sshpass -e sftp -oBatchMode=no ${SFTP_EXTRA} -b - ${SFTP_USER}@${SFTP_HOST} << !
|
||||
sshpass -e sftp -oBatchMode=no ${SFTP_EXTRA} -b - ${SFTP_USER}@${SFTP_HOST} << !
|
||||
cd ${SFTP_PATH}
|
||||
cp ${BACKUP_FILENAME}.gpg ${BACKUP_FILENAME_MONTHLY}.gpg
|
||||
bye
|
||||
@@ -97,4 +98,5 @@ else
|
||||
aws ${AWS_ENDPOINT_OPTIOM} s3 cp s3://$S3_BUCKET_NAME/$BACKUP_FILENAME.gpg s3://$S3_BUCKET_NAME/$BACKUP_FILENAME_MONTHLY.gpg --storage-class DEEP_ARCHIVE || healthchck_fail "failed to create monthly backup"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
healthchck_ok "Success"
|
||||
|
||||
Reference in New Issue
Block a user