Cron jobs tend to run in a less "rich" environment, so you do need to be more explicit about things like paths. In particular, cron on (BSD-based) macosx uses "sh" instead of "bash", which means that the tilde is treated as just a tilde, not a special abbreviation for $HOME. However, cron will start you out in your home directory, so instead of tilde, you can just use period.
Also, your PATH will be limited to "trusted" directories (not including ".")
If your perl script begins with the standard shebang line:
#!/usr/bin/perl
and if the current "mode flags" on the script file allow it to be executable (use the
chmod +x to make the script executable), then your crontab entry can simply be:
23 13 * * * /absolute/path/to/script.pl
(plus any args that the script might need for its @ARGV). Note that if the script writes anything to STDOUT or STDERR, this material will be sent to your mac login account as an email message (check out the unix "mail" command), unless your cron entry includes redirection on the command line, e.g.:
23 13 * * * ./mypath/to/script.pl > cron.out 2> cron.err
In that example, "./" represents your home directory, which is where the output files will be created.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.