BOX.net for Linux (or how to sync from/to WebDAV in general)

Part 2 Create an automatic sync

A Gui-tool for rsync is Grsync.

 1) install incron (Creates an interrupt when a file is changed, and executes a script of your chose)

Link to incron

2) Also install incron-recursive (check directories recursively):

Link to incron-recursive

3) Change and copy the file update.ph according to the readme file.

4) Create an incrontab-job that discover cheches made in the directory.:

OBS! Do not forget the last parameter #$, You should type in 4 lines OBS!

incrontab -e

/home/user/box IN_CREATE,IN_DELETE,IN_CLOSE_WRITE,IN_MOVED_TO /home/user/bin/update.py $# $@ $%

/home/user/boxmirror IN_CREATE,IN_DELETE,IN_CLOSE_WRITE,IN_MOVED_TO /home/user/bin/update.py $# $@ $%

/home/user/box IN_CREATE,IN_DELETE,IN_CLOSE_WRITE /home/user/bin/syncBoxToMirr.sh $#

/home/user/boxmirror IN_CREATE,IN_DELETE,IN_CLOSE_WRITE /home/user/bin/syncMirrToBox.sh $#

4) create a file bin/syncBoxToMirr.sh that contains:

/usr/bin/rsync -rtvcs --progress /home/user/box/ /home/user/boxmirror/

create a file Filen bin/syncMirrToBox.sh that contains:

/usr/bin/rsync -rtvcs --progress /home/user/boxmirror/ /home/user/box/

FINISHED at last!!! :-)

Link to referenses regarding incron: Ref