mirror of
https://codeberg.org/hyperreal/admin-scripts
synced 2024-11-01 16:03:06 +01:00
19 lines
545 B
Bash
Executable File
19 lines
545 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -eu
|
|
|
|
trap "mv /home/mastodon/db-backup.sql.temp /home/mastodon/db-backup.sql" SIGHUP SIGINT SIGQUIT SIGTERM
|
|
trap "rm -v /home/mastodon/db-backup.sql.temp" EXIT
|
|
|
|
mv -v /home/mastodon/db-backup.sql /home/mastodon/db-backup.sql.temp
|
|
|
|
pg_dump -U mastodon -Fc mastodon_production -p 5432 -f /home/mastodon/db-backup.sql
|
|
|
|
rclone sync -c /home/mastodon/live/public/system/ /mnt/mastodon/system
|
|
|
|
rclone copy -c /home/mastodon/db-backup.sql /mnt/mastodon
|
|
|
|
rclone copy -c /home/mastodon/live/.env.production /mnt/mastodon
|
|
|
|
exit 0
|