Skip to content

Instantly share code, notes, and snippets.

@rudiedirkx
Last active February 26, 2024 13:26
Show Gist options
  • Save rudiedirkx/ffe6774a064fda68065eb7d14c01385b to your computer and use it in GitHub Desktop.
Save rudiedirkx/ffe6774a064fda68065eb7d14c01385b to your computer and use it in GitHub Desktop.
DATE="`date +"%d_%H%M"`"
echo "DATE=$DATE"
DB_FILEPATH="/home/forge/backups/dip_db_$DATE.sql"
echo "DB_FILEPATH=$DB_FILEPATH"
STORAGE_FILEPATH="/home/forge/backups/dip_storage_$DATE.tgz"
echo "STORAGE_FILEPATH=$STORAGE_FILEPATH"
echo
echo "database:"
mysqldump --defaults-file=/home/forge/.mysql.prod.cnf --skip-comments prod > "$DB_FILEPATH" || exit 1
ls -lAh "$DB_FILEPATH"
gzip "$DB_FILEPATH"
ls -lAh "$DB_FILEPATH.gz"
/home/forge/bin/dropbox_uploader3.sh upload "$DB_FILEPATH.gz" /DIP/ || exit 1
rm "$DB_FILEPATH.gz"
echo
echo "storage:"
cd /home/forge/app.digitalinsightsplatform.nl
tar -czf "$STORAGE_FILEPATH" storage/a11y_phases
ls -lAh "$STORAGE_FILEPATH"
/home/forge/bin/dropbox_uploader3.sh upload "$STORAGE_FILEPATH" /DIP/ || exit 1
rm "$STORAGE_FILEPATH"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment