mirror of
https://codeberg.org/hyperreal/admin-scripts
synced 2024-11-02 00:13:07 +01:00
18 lines
727 B
Plaintext
18 lines
727 B
Plaintext
|
#!/usr/bin/env bash
|
||
|
|
||
|
set -eu
|
||
|
|
||
|
trap "sudo -u mastodon 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
|
||
|
|
||
|
sudo -u mastodon mv -v /home/mastodon/db-backup.sql /home/mastodon/db-backup.sql.temp
|
||
|
sudo -u mastodon pg_dump -U mastodon -Fc mastodon_production -p 5432 -f /home/mastodon/db-backup.sql
|
||
|
|
||
|
rclone sync -c /etc wasabi:server0-backup/etc/
|
||
|
rclone sync -c /var/log wasabi:server0-backup/var-log/
|
||
|
rclone sync -c /home/jas wasabi:server0-backup/home-jas/
|
||
|
rclone copy -c /home/mastodon/db-backup.sql wasabi:server0-backup/home-mastodon/
|
||
|
rclone copy -c /home/mastodon/live/.env.production wasabi:server0-backup/home-mastodon/
|
||
|
|
||
|
exit 0
|