sapphrc/usr/bin/sapphrc_restore
2024-03-27 13:35:50 -06:00

18 lines
606 B
Bash
Executable file

#!/bin/bash
source ./lib/sapphrc/sapphrc-functions
source ./lib/sapphrc/sapphrc-font
validate_backupdir
cd "$HOME/.config/sapphrc/backups"
git pull --no-edit
sapphrc_config="$HOME/.config/sapphrc"
cat "${sapphrc_config}/active_profiles" | while read profile_name
do
backup_homedir="$sapphrc_config/backups/${profile_name}/home"
include_list="$sapphrc_config/backups/${profile_name}/include"
exclude_list="$sapphrc_config/backups/${profile_name}/exclude"
rsync -avSH --files-from="${include_list}" --exclude-from="${exclude_list}" --exclude '.config/sapphrc/' "${backup_homedir}" "${HOME}"
done