in reply to Automatically delete files

  1. I think the "last modified" stamp is good enough, because nothing is going to change the files once they are created.
  2. You will have to edit /etc/crontab and insert your script there. Alernatively you can just let your script run in a loop and let it sleep a day.
while (1) { #do stuff sleep (24*60*60); }


holli, /regexed monk/

Replies are listed 'Best First'.
Re^2: Automatically delete files
by data64 (Chaplain) on Aug 02, 2005 at 15:03 UTC

    Alernatively you can just let your script run in a loop and let it sleep a day.

    The only issue with this is, if the server is rebooted or that process dies for whatever reason. You will have to manually re-start it when and if you do notice that it is no longer running.

Re^2: Automatically delete files
by fishbot_v2 (Chaplain) on Aug 02, 2005 at 15:42 UTC

    If you do this (loop with a long sleep), don't forget that you will have to update $^T in order for -M to return relevant values:

    # update basetime: $^T = time();

    or else you won't discover any new expired files after the initial run.

Re: Automatically delete files
by MonkPaul (Friar) on Aug 02, 2005 at 14:48 UTC
    Yes, thanks mate. I didnt think of that but seems like a good solution.