i have the following bash script:
#!/bin/sh
dir1=/source/dir/path/
while inotifywait -qqre modify "$dir1"; do
rm -r /destination/dir/path
find /source/dir/path/ -name .svn -exec rm -rf '{}' \;
cp -ruv /source/dir/path/* /destination/dir/path/
done
the thing is that the first 2 commands are working well but the process is killed after executing (successfully) the "find -exec" command. Any thoughts?
BTW- if i remove the "find -exec" everything goes well.
inotifywait
man page says it only exits with status 1, 2, or 3. No status 0. Thus thewhile inotifywait
should never work as it doesn't exit with status 0. – phemmer May 10 '14 at 22:09cp
? Could you try addingset -e
at the beginning of the script? If this does not give any clue, you could try doingstrace find
instead of the solefind
(and eventually post the output somewhere and give us a link). – Andreas Wiese May 10 '14 at 22:370 exit status
and perhaps on CentOS too. Also there's no3 exit status
. – slackmart May 10 '14 at 22:53svn
files. Maybe using:find /source/dir/path/ -name '*.svn' -exec rm -rf '{}' \;
works better. – slackmart May 10 '14 at 22:54