I'm trying to trigger rsync with fswatch, but don't know how I can do it in one line or at least in one script.
I'm testing this with two folders test
and test_bak
in my Documents
folder.
The date.log is just for debugging and should be replace with the rsync command below.
At the moment the file.log is updated everytime a file is changed but the date.log is only updated at the start. I basically don't need the middle part where it logs to file.log.
fswatch Command I'm trying to figure out
fswatch -r ~/Documents/test/ | xargs -n1 >> ~/Documents/file.log | date >> ~/Documents/date.log
Rsync Command
rsync -abmv --delete-after ~/Documents/test/ ~/Documents/test_bak/ --suffix=".rsyncbackup" --backup-dir="_Archived Items" --exclude="_Archived Items"
What is the syntax to "queue" the both log commands so that both files are updated when a file change is detected?