2018-12-05 21:15:03 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -x
|
|
|
|
|
2019-05-20 17:47:26 +00:00
|
|
|
ERP_HOST="example.com"
|
2018-12-05 21:15:03 +00:00
|
|
|
DATE="$(date --iso-8601)"
|
|
|
|
DISPLAY=:0
|
|
|
|
|
|
|
|
BACKUP_DIR="$HOME/Documents/Backup"
|
|
|
|
|
|
|
|
echo "Exporting database dump"
|
2019-05-20 17:47:26 +00:00
|
|
|
/usr/bin/setsid ssh "$ERP_HOST" \
|
2018-12-05 21:15:03 +00:00
|
|
|
dokku mariadb:export erp \
|
2019-05-20 17:47:26 +00:00
|
|
|
> "$BACKUP_DIR/$ERP_HOST.$DATE.sql"
|
2018-12-05 21:15:03 +00:00
|
|
|
|
|
|
|
echo "Exporting files"
|
2019-05-20 17:47:26 +00:00
|
|
|
/usr/bin/setsid ssh "$ERP_HOST" \
|
2018-12-05 21:15:03 +00:00
|
|
|
docker exec erp.web.1 \
|
|
|
|
"bash -c 'cd /var/www/html/documents ; tar czf - .'" \
|
2019-05-20 17:47:26 +00:00
|
|
|
> "$BACKUP_DIR/$ERP_HOST.$DATE.tar.gz"
|
2018-12-05 21:15:03 +00:00
|
|
|
|