Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if [[ -z "$TARGET_FOLDER" ]]; then
exit 1
fi

mongodump --uri "$MONGO_URI" --gzip --archive | aws s3 cp - "${TARGET_S3_FOLDER%/}/backup-$DATE.tar.gz"
mongodump --uri "$MONGO_URI" --gzip --archive | `which aws` s3 cp - "${TARGET_S3_FOLDER%/}/backup-$DATE.tar.gz"
echo "Mongo dump uploaded to $TARGET_S3_FOLDER"
else
# save dump locally (and optionally to AWS S3)
Expand All @@ -26,7 +26,7 @@ else
echo "Mongo dump saved to $FILE"

if [[ -n "$TARGET_S3_FOLDER" ]]; then
aws s3 cp "$FILE" "$TARGET_S3_FOLDER"
`which aws` s3 cp "$FILE" "$TARGET_S3_FOLDER"
echo "$FILE uploaded to $TARGET_S3_FOLDER"
fi
fi
Expand Down