The basic format of the crontab entry is
minute hour day_of_month month day_of_week your_command_to_execute
The '*' for the first five fields just means 'every'. So to run a command every day at 1:30 we use:
30 1 * * * some_command
See man 5 crontab for a fuller description of the values you can use in those first five columns.

So now, the main part is what to put for "some_command".. i used this line, which is all part of a single find command:
find /home/march05/msc0516/public_html/Blast/updated/ -mtime 1 -exec / +bin/rm '{}' \;
This (man find) tells find to A) look in your Blast/updated/ directory, B) take files modified a day ago, and C) execute "/bin/rm FILENAME" for each one.

If you wanted to simply cron your perl script instead, it would be something like:
30 1 * * * /home/march05/msc0516/public_html/Blast/deleteFiles.pl
Note also that the cron daemon will email you any output generated by the commands that are invoked by the crontab ... this is very handy for getting emails of errors.

note that google(cron tutorial) will yield a slew of results.

In reply to Re^3: Automatically delete files by davidrw
in thread Automatically delete files by MonkPaul

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.