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"
|
|
|
|
|
2022-07-01 16:08:49 +00:00
|
|
|
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
|