Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] scripts not running in cron.hourly, etc.




I have recently tried experimenting with running administrative scripts from cron.daily and cron.hourly instead of my regular cron file (crontab
-e). But the scripts I put into these folders don't seem to run.

Note that when called from cron, your PATH variable will be set to only /bin and /sbin or something like that. It was my common mistake to call executable, such as "perl" without full path and it would fail. Some more useful tips

#!/bin/bash -x

would turn on trace mode, it will verbosely output everything it's going to execute.

/path/to/script.pl > /tmp/run_trace 2>&1

this would output stdout and stderr into the file. First of all, check if file is created, then look into the content. Don't leave it's like this, it's a security hole to rely
on define filename in /tmp/ (read about mktemp if it bothers you)


hope this helps,
romans



Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links