On aussie, i.e. the wiki server, I've got a script that emails me when uploaded files have been changed. It works well on many days, but every few days it misbehaves.

Here's the algorithm of the script:

* Check if the script has been executed within the last day, if not:
** Generate a list of files using a command similar to:
        cd /home/lyx/www/pmwiki
        find uploads -printf '%TY-%Tm-%Td %TH:%TM  %-8s  %p\n' > files
** 'diff' this list with a previous list of files, and email me
   the difference if it is non-empty.

Normally 'files' will begin with something like:

        2007-01-21 18:15  4096      uploads
        2006-07-16 16:02  4096      uploads/SiteTest
        2005-04-28 17:59  4096      uploads/SiteTest/ADir
        2004-02-11 11:54  4         uploads/SiteTest/ADir/Aßß.txt
        2007-02-06 09:21  10        uploads/SiteTest/aFile.txt
        2005-05-24 12:50  4096      uploads/SiteTest/test
        2003-11-22 17:29  10        uploads/SiteTest/test/aFile.txt
        2005-04-28 18:01  4096      uploads/SiteTest/test/test4
        2003-11-22 17:56  10        uploads/SiteTest/test/test4/aFile.txt
        2005-03-31 21:35  11        uploads/SiteTest/test/test.txt
        ...

However, every few days it will _only_ contain the following line:

        2005-05-19 22:46  28        uploads

What's going on here?
* Why only a single line, where are the rest of the files?
* Why is the date 2005-05-19 ???

I'm stumped, any ideas?

/Christian

PS. I might be able to "fix" the script by checking if 'files' contains a single line, and then try to repeat the 'find' command. Not a pretty solution though...

PPS.
The list of files are stored in:
        /home/lyx/www/pmwiki/wiki.d/files
in case anyone wants to look.

The actual script is in
        /home/lyx/www/pmwiki/farm.d/cookbook/filesNotify.php

--
Christian Ridderström, +46-8-768 39 44               http://www.md.kth.se/~chr

Reply via email to