Strange cron behavior
atom.powers at gmail.com
Tue Oct 3 21:39:52 PDT 2006
On 10/3/06, stan <stanb at panix.com> wrote:
> I'm having a hard time getting cron to run a task. I've run crontab -e
> (as root), and added the following line:
> 12 * * * * /usr/local/bin/mirror_ubuntu
> This script runs from teh command line. Now I've seen plenty of
> strange beahviour because of the limited environment cron tasks
> get, but a basic "echo "test" >> /tmp/stan isn't even creating
> the file.
Even your basic script is making assumptions about the environment.
When writing cron scripts always use full-path to your executables and
be very aware of when you are globbing. If I recall, cron won't allow
globbing (the '*' and '?' characters in paths) in commands unless
explicitly enabled, and the only path you get is that defined in your
Perfection is just a word I use occasionally with mustard.
More information about the freebsd-questions