Created
March 30, 2021 06:00
-
-
Save antonshell/e5f7104bc8a6ff35ffe89f417a4aa2d3 to your computer and use it in GitHub Desktop.
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 | |
TIMESTAMP=$(date +"%F-%T") | |
FILES_DIR=/var/www/my_website/web/uploads | |
BACKUP_DIR="/var/backups/files/my_website_backups/$TIMESTAMP" | |
TAR=/usr/bin/tar | |
AWS=/usr/bin/aws | |
mkdir -p "$BACKUP_DIR" | |
$TAR -zcvf $BACKUP_DIR/files.tar.gz $FILES_DIR | |
$AWS s3 cp $BACKUP_DIR s3://my-website-backups/files/$TIMESTAMP --recursive | |
rm -rf "$BACKUP_DIR" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment