[ILUG] cron strangeness

Brian Foster blf at blf.utvinternet.ie
Sat Aug 19 18:52:51 IST 2006


 is find(1) really the correct tool to use here?
 do you _really_ want to blow up all *.incoming/
 dirs in the /tmp hierarchy; e.g.:

   /tmp/a/directiory/in/tmp/containing/an.incoming/...

 or only in /tmp itself; e.g.:

   /tmp/blowupthis.incoming/...
   /tmp/but/do/not/blow/up/this.incoming/...

 if the later, simpy use a wildcard (shell globbing):

   /tmp/*.incoming/

 (note the trailing slash (/) to force it to only
 match directories); e.g. (not tested!):

   touch -d '20 hours ago' /tmp/$$
   for d in /tmp/*.incoming/; do
      [ "$d" -nt /tmp/$$ ] || rm -rf -- "$d"
   done
   rm -f /tmp/$$

cheers!
	-blf-

-- 
Experienced (20+ yrs) kernel/software Eng: | Brian Foster   Montpellier,
 • Unix, embedded, &tc;  • Linux;  • doc;  | blf at utvinternet.ie   FRANCE
 • IDL, automated testing, process, &tc.   |  Stop E$$o (ExxonMobile)!
Résumé (CV) http://www.blf.utvinternet.ie  |     http://www.stopesso.com



More information about the ILUG mailing list