osx - fswatch + rsync alternative or better inplementation -
i'm trying watch folder, , subfolders changes in files (html/css/js/etc). once file has changed, want upload mounted drive remote server. currently, using in terminal:
fswatch -o ~/desktop/site/ | xargs -n1 sh ~/documents/app\ syncs/rsync_files.sh
rsync_files.sh:
rsync -rvzut --info=progress2 --delete-after --delete-excluded --exclude-from=/users/me/documents/app\ syncs/exclude_list.txt /users/me/desktop/site/ /volumes/devroot$/site;
the thought fswatch call rsync each time there change in file structure. works, slow, esp on crappy connection.
my question is, doing right or there better solution i'm trying accomplish? can rsync command better optimized? there app made thing me?
basically want mimic file panel in dreamweaver 2014 without having use dreamweaver. setup sublime text 3 , codekit 2.
i guess depends on bottleneck is, not clear in question. 1 thing though: if connection "crappy", i'd worry fixing connection before trying tune rsync
.
as far fswatch
concerned, using -o
, devise no further way improve performance. maybe increase latency value (-l
): command in question output events maximum frequency of 1 second. tune higher value: start value on same order of magnitude of amount of time taken synchronisation job finish.
as far rsync
concerned, may find room improvement. start asking following questions (and google it):
- is
rsync
best option? - would whole-file copy (
-w
) make sense? - does compression (
-z
) make sense? - does in-place synchronisation (
--inplace
) make sense?
if connection slow, start using -z
, --inplace
, see whether rsync
performance improves.
Comments
Post a Comment