forked from kunsi/dotfiles
.bin/backup-and-update-system: ignore rsync error code 24
This commit is contained in:
parent
2b574833e0
commit
633cde6d8b
1 changed files with 30 additions and 20 deletions
|
@ -14,6 +14,7 @@ do
|
||||||
done
|
done
|
||||||
|
|
||||||
# Do a backup.
|
# Do a backup.
|
||||||
|
(
|
||||||
rsync -zaAP --numeric-ids --delete --relative \
|
rsync -zaAP --numeric-ids --delete --relative \
|
||||||
--rsync-path="/usr/bin/rsync --fake-super" \
|
--rsync-path="/usr/bin/rsync --fake-super" \
|
||||||
-e "ssh" --delete-excluded \
|
-e "ssh" --delete-excluded \
|
||||||
|
@ -35,5 +36,14 @@ rsync -zaAP --numeric-ids --delete --relative \
|
||||||
--exclude "/home/kunsi/VirtualBox VMs/" \
|
--exclude "/home/kunsi/VirtualBox VMs/" \
|
||||||
"/home/kunsi" "kunsi-t470@home.nas":backups/
|
"/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
|
||||||
|
|
Loading…
Reference in a new issue