I am trying to schedule a perl script to run daily, but I am not sure if I am doing everything right.
The script I want to run is to update AWStats each day, without manually having to press update.
Currently, I created a file in the cron.d folder with the following text inside:
00 09 * * * /usr/local/awstats/cgi-bin/awstats.pl -config=cwp-dev-02
If I run:
/usr/local/awstats/cgi-bin/awstats.pl -config=cwp-dev-02
The stats update succesfully, but nothing seems to happen with the scheduled task...
I think you need to include a username in the job spec e.g.
because the files in /etc/cron.d are treated in the same way as the /etc/crontab file. Also check that only root can write to the file.
Don't copy such files directly into
cron.d
- instead use the crontab(1) command to inject new commands.Suppose your entries are in a file named
mycrontab
:and you're done