dotfiles-old/.local/scripts/backup.sh

23 lines
520 B
Bash
Raw Normal View History

2022-03-10 03:42:22 +00:00
#!/usr/bin/env sh
BACKUP_LOC="/media/SEAGATE/HOME_BACKUP/"
DIR="$HOME/"
EXCLUDE_CONF="$HOME/.config/rsync-exclude.conf"
EXCL_INCL="--exclude-from=$EXCLUDE_CONF"
2022-03-10 03:42:22 +00:00
if [ "$1" = "-r" ]; then
notify-send "backup.sh" "restoring from backup"
rsync -ru $EXCL_INCL "$BACKUP_LOC" "$DIR"
else
notify-send "backup.sh" "performing backup"
if [ -d $BACKUP_LOC ]; then
rsync -arP --delete $EXCL_INCL "$DIR" "$BACKUP_LOC"
else
notify-send "backup.sh" "backup location not found"
fi
fi
2022-07-04 23:44:31 +00:00
sync