2021-11-30 17:46:31 +00:00
|
|
|
#!/bin/bash
|
2018-12-21 16:38:50 +00:00
|
|
|
|
2021-11-30 17:46:31 +00:00
|
|
|
set -xeuo pipefail
|
2018-12-21 16:38:50 +00:00
|
|
|
|
2020-11-25 21:05:24 +00:00
|
|
|
# Push some git repos
|
2018-12-21 16:38:50 +00:00
|
|
|
pass git push
|
2019-09-24 14:13:41 +00:00
|
|
|
git --git-dir=$HOME/.cfg/ --work-tree=$HOME push
|
2018-12-21 16:38:50 +00:00
|
|
|
|
2020-12-23 08:08:37 +00:00
|
|
|
# Fetch a fresh copy of all locally cloned git repos
|
|
|
|
for dir in $(find /home/kunsi/git -mindepth 1 -maxdepth 1 -type d)
|
|
|
|
do
|
2021-07-09 10:42:32 +00:00
|
|
|
git -C "$dir" fetch || true
|
2020-12-23 08:08:37 +00:00
|
|
|
done
|
|
|
|
|
2020-11-25 21:05:24 +00:00
|
|
|
# Do a backup.
|
2021-07-30 06:39:54 +00:00
|
|
|
(
|
|
|
|
rsync -zaAP --numeric-ids --delete --relative \
|
|
|
|
--rsync-path="/usr/bin/rsync --fake-super" \
|
|
|
|
-e "ssh" --delete-excluded \
|
|
|
|
--exclude "/home/kunsi/.cache/" \
|
|
|
|
--exclude "/home/kunsi/.config/Ferdi/" \
|
2021-09-18 15:41:55 +00:00
|
|
|
--exclude "/home/kunsi/.config/Rambox/" \
|
2021-07-30 06:39:54 +00:00
|
|
|
--exclude "/home/kunsi/.local/lib/python*/site-packages/" \
|
|
|
|
--exclude "/home/kunsi/.local/share/TelegramDesktop/tdata/user_data/cache/" \
|
2021-09-18 15:41:55 +00:00
|
|
|
--exclude "/home/kunsi/.local/share/sddm/" \
|
2021-07-30 06:39:54 +00:00
|
|
|
--exclude "/home/kunsi/.mozilla/firefox/*/storage/*" \
|
|
|
|
--exclude "/home/kunsi/.npm/" \
|
|
|
|
--exclude "/home/kunsi/.nvm/" \
|
|
|
|
--exclude "/home/kunsi/.platformio/" \
|
|
|
|
--exclude "/home/kunsi/.ssh/cm-*" \
|
|
|
|
--exclude "/home/kunsi/.vdirsyncer" \
|
|
|
|
--exclude "/home/kunsi/Downloads/" \
|
|
|
|
--exclude "/home/kunsi/Schreibtisch/" \
|
|
|
|
--exclude "/home/kunsi/VirtualBox VMs/" \
|
2021-09-18 15:41:55 +00:00
|
|
|
--exclude "/home/kunsi/qemu/Windows_10.qcow2" \
|
|
|
|
--exclude "/home/kunsi/tmp.*/" \
|
2021-07-30 06:39:54 +00:00
|
|
|
"/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
|
|
|
|
)
|
2020-11-25 21:05:24 +00:00
|
|
|
|
2021-12-30 15:17:29 +00:00
|
|
|
printf '\aPress enter to continue with updating the system\n'
|
2021-11-30 17:46:31 +00:00
|
|
|
read
|
|
|
|
|
2020-11-25 21:05:24 +00:00
|
|
|
# Do updates
|
2021-07-09 10:42:32 +00:00
|
|
|
sudo pacman -Syu --noconfirm
|