.bin/backup-and-update-system: ignore rsync error code 24

This commit is contained in:
Franzi 2021-07-30 08:39:54 +02:00
parent 2b574833e0
commit 633cde6d8b
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -14,26 +14,36 @@ do
done done
# Do a backup. # Do a backup.
rsync -zaAP --numeric-ids --delete --relative \ (
--rsync-path="/usr/bin/rsync --fake-super" \ rsync -zaAP --numeric-ids --delete --relative \
-e "ssh" --delete-excluded \ --rsync-path="/usr/bin/rsync --fake-super" \
--exclude "/home/kunsi/.cache/" \ -e "ssh" --delete-excluded \
--exclude "/home/kunsi/.config/Rambox/" \ --exclude "/home/kunsi/.cache/" \
--exclude "/home/kunsi/.config/Ferdi/" \ --exclude "/home/kunsi/.config/Rambox/" \
--exclude "/home/kunsi/.local/lib/python*/site-packages/" \ --exclude "/home/kunsi/.config/Ferdi/" \
--exclude "/home/kunsi/.local/share/sddm/" \ --exclude "/home/kunsi/.local/lib/python*/site-packages/" \
--exclude "/home/kunsi/.local/share/TelegramDesktop/tdata/user_data/cache/" \ --exclude "/home/kunsi/.local/share/sddm/" \
--exclude "/home/kunsi/.mozilla/firefox/*/storage/*" \ --exclude "/home/kunsi/.local/share/TelegramDesktop/tdata/user_data/cache/" \
--exclude "/home/kunsi/.npm/" \ --exclude "/home/kunsi/.mozilla/firefox/*/storage/*" \
--exclude "/home/kunsi/.nvm/" \ --exclude "/home/kunsi/.npm/" \
--exclude "/home/kunsi/.platformio/" \ --exclude "/home/kunsi/.nvm/" \
--exclude "/home/kunsi/.ssh/cm-*" \ --exclude "/home/kunsi/.platformio/" \
--exclude "/home/kunsi/.vdirsyncer" \ --exclude "/home/kunsi/.ssh/cm-*" \
--exclude "/home/kunsi/Downloads/" \ --exclude "/home/kunsi/.vdirsyncer" \
--exclude "/home/kunsi/qemu/Windows_10.qcow2" \ --exclude "/home/kunsi/Downloads/" \
--exclude "/home/kunsi/Schreibtisch/" \ --exclude "/home/kunsi/qemu/Windows_10.qcow2" \
--exclude "/home/kunsi/VirtualBox VMs/" \ --exclude "/home/kunsi/Schreibtisch/" \
"/home/kunsi" "kunsi-t470@home.nas":backups/ --exclude "/home/kunsi/VirtualBox VMs/" \
"/home/kunsi" "kunsi-t470@home.nas":backups/
# Exit code 24 means some files have vanished during rsync.
# I don't know why, but this is very common, apparently?
exitcode=$?
if [[ $exitcode != 0 ]] && [[ $exitcode != 24 ]]
then
exit 1
fi
)
# Do updates # Do updates
sudo pacman -Syu --noconfirm sudo pacman -Syu --noconfirm