As already stated, it's generally an environment issue when something works on the command line, but not from cron. In this specific case, I suspect issue is not an environment
variable, though, but rather the working directory. You start off by opening your input file with the assumption that it's in the current directory, but you can't make assumptions like that under cron - unless you've tested, how do you know whether cron runs the script from your home directory, from /tmp, or from just about anywhere else on the system? Does your script work from the command line if you run it from a random, arbitrary directory? (Unless you have a copy of default.db in every directory on the system, I expect not.)
For cron shortcuts, note that 1-59/5 will only run the job 11 times per hour (at :05, :10,... :55 - nothing on the hour). 0-59/5 will get in the 12th run at :00, but if that's what you want, you can do it even more simply with */5, to run whenever the value is a multiple of 5.
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.