#!/bin/bash
DIR=/home/marcel/code/bookmarks/
while RES=$(inotifywait -e create -e modify -e delete -e move -r $DIR --format %f .)
do
	echo `date` :: $RES
  rsync -rt --delete /home/marcel/code/bookmarks/ /home/marcel/code/nextcloud-docker-dev/apps/bookmarks
	sudo -u marcel -i <<-END
	. /home/marcel/.bashrc
	. /home/marcel/.bash_profile
	cd "$DIR"
	END
done
