From cf8bfb132319be4110829f9c770c17de84c77394 Mon Sep 17 00:00:00 2001 From: Jeffrey Serio <23226432+hyperreal64@users.noreply.github.com> Date: Sun, 21 Jul 2024 21:48:15 -0500 Subject: [PATCH] Use tmp dir to rsync /var/log --- bin/server0_backup | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/server0_backup b/bin/server0_backup index 13a0465..bcda60a 100755 --- a/bin/server0_backup +++ b/bin/server0_backup @@ -3,13 +3,17 @@ 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 +trap "rm -rf /tmp/log" SIGHUP SIGINT SIGQUIT SIGTERM +trap "rm -rv /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 minio:server0-backup/etc/ -rclone copy /var/log minio:server0-backup/var-log/ +mkdir /tmp/log +rsync -avz /var/log/ /tmp/log +rclone sync /tmp/log minio:server0-backup/var-log/ +rm -rf /tmp/log rclone sync -c /home/jas minio:server0-backup/home-jas/ rclone copy -c /home/mastodon/db-backup.sql minio:server0-backup/home-mastodon/ rclone copy -c /home/mastodon/live/.env.production minio:server0-backup/home-mastodon/