kunsis-dotfiles/.bin/backup-and-update-system

23 lines
545 B
Bash
Executable file

#!/bin/bash
set -xeuo pipefail
# Push some git repos
pass git push
git --git-dir=$HOME/.cfg/ --work-tree=$HOME commit -am "Auto-commit $(hostnamectl --static) $(date '+%F %T')"u
git --git-dir=$HOME/.cfg/ --work-tree=$HOME push
# Fetch a fresh copy of all locally cloned git repos
for dir in $(find /home/kunsi/git -mindepth 1 -maxdepth 1 -type d)
do
git -C "$dir" fetch --all || true
done
# Do a backup.
sudo /usr/local/bin/generate-backup-with-retries
printf '\a'
# Do updates
sudo pacman -Syu
sudo DIFFPROG='diff -u --color' pacdiff