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

24 lines
544 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')"
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