From 85caad807f0843f45c12cef324f536f5fdecb162 Mon Sep 17 00:00:00 2001 From: Jeffrey Serio <23226432+hyperreal64@users.noreply.github.com> Date: Mon, 22 Jul 2024 21:41:19 -0500 Subject: [PATCH] Use rsync first --- bin/server0_backup | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/bin/server0_backup b/bin/server0_backup index f9be21a..7bb8260 100755 --- a/bin/server0_backup +++ b/bin/server0_backup @@ -10,14 +10,23 @@ 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 copy -L /etc minio:server0-backup/etc/ +mkdir "${TEMP_DIR}/etc" +etc_copy_items=( + "caddy" + "docker" + "postgresql" + "systemd/network" + "thelounge" +) +for item in "${etc_copy_items[@]}"; do + rsync -avz "/etc/$item" "${TEMP_DIR}/etc" +done mkdir "${TEMP_DIR}/log" rsync -avz /var/log/ "${TEMP_DIR}/log" -rclone sync -L "${TEMP_DIR}/log"/ minio:server0-backup/var-log/ mkdir "${TEMP_DIR}/jas" -copy_items=( +jas_copy_items=( "cdn" "docker" "public" @@ -29,10 +38,11 @@ copy_items=( ".zshrc" ".gemini-certs" ) -for item in "${copy_items[@]}"; do +for item in "${jas_copy_items[@]}"; do rsync -avz "/home/jas/$item" "${TEMP_DIR}/jas" done -rclone sync -L -c "${TEMP_DIR}/jas"/ minio:server0-backup/home-jas/ + +rclone sync "${TEMP_DIR}"/ minio:server0-backup/ 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/