From af04353d64144ad4fed010b19c4e48b719843937 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Wed, 26 Jul 2023 04:46:39 -0400 Subject: [PATCH] use fsync and preallocation for rsync --- deploy-static | 10 +++++----- local-backup | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/deploy-static b/deploy-static index 4aceab1..2c2b299 100755 --- a/deploy-static +++ b/deploy-static @@ -25,14 +25,14 @@ echo target is $target echo ssh $remote "rm -rf $target && cp -a $active $target" -rsync -rpcv --fsync --chmod=D755,F644 --delete static-tmp/ $remote:$target +rsync -rpcv --chmod=D755,F644 --delete --fsync --preallocate static-tmp/ $remote:$target ssh $remote "ln -snf $target /srv/element.grapheneos.org && sync /srv/element.grapheneos.org" echo "root $target;" > nginx-tmp/root_element.grapheneos.org.conf -rsync -rptcv --fsync --chmod=D755,F644 --delete nginx-tmp/{nginx.conf,mime.types,root_element.grapheneos.org.conf,snippets} $remote:/etc/nginx/ -rsync -ptcv --fsync --chmod=755 {local-backup,remote-backup} $remote:/usr/local/bin/ -rsync -ptcv --fsync --chmod=644 systemd/system/remote-backup.timer $remote:/etc/systemd/system/remote-backup.timer -rsync -ptcv --fsync --chmod=644 systemd/system/remote-backup.service $remote:/etc/systemd/system/remote-backup.service +rsync -rptcv --chmod=D755,F644 --delete --fsync --preallocate nginx-tmp/{nginx.conf,mime.types,root_element.grapheneos.org.conf,snippets} $remote:/etc/nginx/ +rsync -ptcv --chmod=755 --fsync --preallocate {local-backup,remote-backup} $remote:/usr/local/bin/ +rsync -ptcv --chmod=644 --fsync --preallocate systemd/system/remote-backup.timer $remote:/etc/systemd/system/remote-backup.timer +rsync -ptcv --chmod=644 --fsync --preallocate systemd/system/remote-backup.service $remote:/etc/systemd/system/remote-backup.service ssh $remote nginx -s reload echo diff --git a/local-backup b/local-backup index 8693e74..ad05465 100755 --- a/local-backup +++ b/local-backup @@ -12,6 +12,6 @@ ssh $remote "mkdir local-backup/$timestamp" ssh $remote "pg_dumpall -U postgres > local-backup/$timestamp/all_databases.sql" ssh $remote "cp -r /etc/synapse local-backup/$timestamp/synapse" ssh $remote "tar -cC local-backup $timestamp | zstd -9 | age -r \$(cat backup-public-key.txt) -o local-backup/$timestamp.tar.zst.age" -rsync -v $remote:./local-backup/$timestamp.tar.zst.age backup/ +rsync -v --fsync --preallocate $remote:./local-backup/$timestamp.tar.zst.age backup/ ssh $remote "rm -rf local-backup"