intrigeri <[email protected]> écrivait (wrote) :
> Hi Jean Charles,
>
> Jean Charles Delépine wrote (17 Sep 2012 15:04:15 GMT) :
> > Problem : if one file changes in /etc, /etc will be found as changed
> > by find, and no testing state will be saved.
>
> Right. metche 1.2.2 has a tentative fix for that issue.
metche 1.2.2 choose to not printing $WATCHED_DIR if it is in the search
answer. Good point for me. My problem is out : /etc/blkid.tab
still changes /etc every 20mn but /etc changes are ignored. My
/var/lib/metche will not be full anymore. \o/
> > A solution might be to only search for files, not directories (works
> > here):
>
> Thanks a lot for this suggestion.
>
> Can you please try to reproduce the problem you were experiencing with
> an unpatched metche 1.2.2-1 (currently in Debian testing/unstable,
> installable as-is in Squeeze) and report back if you can still
> reproduce it?
I can't reproduce it for $WATCHED_DIR, but any file edited and not
saved in $WATCHED_DIR/bla/ will change $WATCHED_DIR/bla/ date and one
unstable will be saved. :
# find /etc -path /etc -or -newer /var/lib/metche/unstable-latest.tar.bz2 -print
# vim /etc/default/rcS
# find /etc -path /etc -or -newer /var/lib/metche/unstable-latest.tar.bz2 -print
/etc/default
No change in rcS but vim creates a file /etc/default/.rcS.swp (ignored).
/etc/default changes and will generate an unneeded unstable save file.
> If you can, then I'll happily consider applying your patch :)
If you consider applying it you should take the patch attached for 1.2.2:
in order to have testing and stable tarballs the test -cmin "-$time"
has also to be modified.
If -type f is used there's no more needs of -path $WATCHED_DIR in $FIND_OPTS
but the patch will be biggest.
Cheers,
Jean Charles Delépine
--
http://www.laquadrature.net/soutien
--- /tmp/metche 2012-09-18 11:52:00.940607761 +0200
+++ /usr/sbin/metche 2012-09-18 11:55:08.123714254 +0200
@@ -692,7 +692,7 @@
time="$1"
set -o noglob
- if [ -z "$(find $(print_watched_files) $FIND_OPTS -cmin "-$time" -print | head -1)" ]; then
+ if [ -z "$(find $(print_watched_files) -type f '(' $FIND_OPTS -cmin "-$time" -print ')' | head -1)" ]; then
set +o noglob
return 0
else
@@ -707,7 +707,7 @@
ref_file="$1"
set -o noglob
- if [ "$(find $(print_watched_files) $FIND_OPTS -newer "$ref_file" -print | head -1)" ]; then
+ if [ "$(find $(print_watched_files) -type f '(' $FIND_OPTS -newer "$ref_file" -print ')' | head -1)" ]; then
set +o noglob
return 0
else