I posted a similar question last week, but this is not a complete re-post. Hopefully, I'm not breaking any etiquette rules.

I am a Perl novice, new to Mac, and have limited and dated experience with UNIX (15 years ago).

I am using Mac OS X 10.5. I want to execute a perl script automatically, once per day, every day. In my previous post it was suggested that I set up a file (called cron.txt and then enter crontab cron.txt in my Terminal.

Okay, so here is what I have done. In my cron.txt file I have the line 21 08 * * * /usr/bin/perl -w /Users/myname/Documents/path/to/CronTest.pl. I copied that "sixth variable" part (the part starting with /usr and all the way through /CronTest.pl) to the command line in my Terminal window and the script executed fine, so I know that command part of the cron listing is correct. (BTW, what is that "sixth variable" called? In my mind I'm calling it the command, but am not sure if this is correct.)

It was 8:19 a.m. when I saved the cron.txt file and still 8:19 when I entered crontab cron.txt. I checked crontab by entering crontab -l and it appeared to be correct. When 8:21 rolled around, however, nothing happened.

Any help would be greatly appreciated. Is there some way that I can check for errors, or see if the line is even executing?

Thanks for your help!


In reply to Cron on Mac OS X by Ninth Prince

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.