Crontab help

I have a cron job setup but it’s not working :.

It’s set to:

*/5 * * * * /usr/execute/something /home/directory/somescript.cron --extra_config=config.xml

It says (when I just type out the cronjob command):

Reading configuration file: config.xml
[ERROR] Cannot read configuration file: config.xml
Configuration file errors – exiting.

But I know it’s working because when I just type out

python somescript.cron --extra_config=config.xml

it works fine.

What should I do?


If this is working, I want to set it to execute every 24 hours…

How about using the full path for config.xml?

And to get a cron to execute once every 24 hours, say at 2:30 in the morning, you’ll need (but already know):
30 2 * * * /yourcommand

If you want to keep testing this thing using cron, you can do:
at now + 1 minute
at> usr/execute/something /home/directory/somescript.cron --extra_config=/fullpath/config.xml
at> ^d

There might be a more graceful way to input ‘at’ commands, but I’m lazy and do it the above way.


It’s not executing anything! The script file that is supposed to be updated isn’t being updated. Argg, this is so complicated!

the at> thing doesn’t work either…

Without knowing exactly what you’re running in cron, it’s just hard to guess what the problem is. What’s the /usr/execute/something? And what does somescript.cron do?


I’m trying to python a sitemap script from Google.

I downloaded the sitemap script and got it to work. It looks like --extra_config is not a valid flag. Here’s what worked for me:
garth:~/> at now + 1 minute
warning: commands will be executed using /bin/sh
at> /usr/bin/python ~/ --config=config.xml
job 51316 at 2006-10-15 16:40

And it emailed me normal results.


What email did it send it?

The email was the output of the cronjob, which is exactly what it spews when run manually from the command line:

Reading configuration file: config.xml
Opened URLLIST file: urllist.txt
Walking DIRECTORY "/home/sdayman/"
Walking DIRECTORY "/home/sdayman/"
Opened ACCESSLOG file: /home/sdayman/logs/
Opened ACCESSLOG file: /home/sdayman/logs/
Sorting and normalizing collected URLs.
Writing Sitemap file “/home/sdayman/” with 2864 URLs
Notifying search engines.
Count of file extensions on URLs:
11 (no extension)
2 .afm
2 .conf
45 .css
1 .db
1 .dis
1 .fcgi
359 .gif
26 .htm
305 .html
3 .ico
1 .inc
38 .jpg
128 .js
3 .pdf
519 .php
1 .php-dist
9 .pl
29 .pm
867 .png
3 .py
102 .txt
1 .wbm
93 .xml
1 .xsd
1 .xslt
1 .zip
311 /
Number of errors: 0
Number of warnings: 0

But the main point is that you used the flag --extra_config=config.xml when it’s supposed to just be --config=config.xml


I got it fixed, but it won’t email me anything. What email address did it send that info to you?