Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- BACKUP_PARENT=$HOME/.config/vivaldi/viv_session
- BACKUP_LAST=$(find "$BACKUP_PARENT" -type d | sort -h | tail -n 1)
- VIVDIR=$HOME/.config/vivaldi/Default
- diff "$BACKUP_LAST/Current Session" "$VIVDIR/Current Session" > /dev/null 2>&1
- if [ $? -eq 0 ]; then
- #echo "no change"
- exit 0;
- fi
- TMPDIR=$BACKUP_PARENT/$(date "+%Y%m%d_%H%M%S")
- #echo $TMPDIR
- mkdir -p "$TMPDIR"
- cp -p "$VIVDIR"/Last\ * "$VIVDIR"/Current\ * "$TMPDIR"
- #prune old dirs
- find "$BACKUP_PARENT" -mindepth 1 -maxdepth 1 -type d | sort -h | head -n -10 | xargs rm -rf
Add Comment
Please, Sign In to add comment