Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a linux server where I want to install a Cron.

I was given a URL, and by visiting this URL (GET request), it will automatically rebuild a new sitemap for my website.

Basically, I want a cron to go to this URL once a day, thus my sitemap will be regenerated once a day

I'm not sure what info I need to give you regarding cron on my server...but when I go to /etc/ I can see... cron.d , cron.daily , cron.deny , cron.hourly , cron.monthy , crontab

one other thing, when i visit the GET request url myself, it takes a while before the page loads. It takes about 1-2 minutes and then a "SITEMAP COMPLETE" page appears. So the cron will have to stay at it for the entire duration until that message appears, else the sitemap will only partially regenerate.

Edit * I think I found the answer, can someone please confirm of this is correct ??? In crontab -e, I enter:

0 0 1 * * /usr/bin/wget -q -O - ""

share|improve this question
up vote 1 down vote accepted

You can use 'wget' or 'curl', so yes your example is correct. You can ether add it with crontab -e or add the line to /etc/crontab (But add which user to run as)

share|improve this answer
If i use the wget, will it save a file on my server somewhere everytime the cron is run? – Greatestswordsman Jun 11 '11 at 22:51
@Virendar Yes, if you use CURL it won't (Unless you specify the -O flag, but don't do that). Just set the command as curl http://yourdomain/script.php and that will download the file but not save it – Smudge Jun 11 '11 at 22:53
@Virendar you could use wget with --spider as argument and that will make don't save the output – Gabriel Sosa Jun 11 '11 at 22:57
hmm, so wget -q -O should be changed to either wget --spider or curl ? – Greatestswordsman Jun 11 '11 at 23:19
@Verendar Ether use wget --spider http://yourdomain/script.php or curl http://yourdomain/script.php, not both =) I prefer CURL, purely because the syntax is easier, there's probably a performance comparison somewhere but it's more down to personal choice, which one you find easier to use. – Smudge Jun 11 '11 at 23:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.