Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

This question already has an answer here:

How can I setup a cron job in debian to run a certain url once every hour. There`s no control panel or anything.

share|improve this question

marked as duplicate by Dennis Kaarsemaker, Bryan, growse, Michael Hampton Jun 24 '13 at 23:23

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2  
Same as on every other distro. –  Ignacio Vazquez-Abrams Mar 11 '11 at 4:20
    
where`s the file located –  Belgin Fish Mar 11 '11 at 4:22

5 Answers 5

You can do that in different ways:

  • Make a simple script to run the command and copy it to /etc/cron.hourly (don't forget to add the execute permission on it).
  • Add a snippet of crontab to /etc/cron.d.
  • Use crontab -e as root and add a line to it executing the command directly.

To access an URL you can use links, lynx, wget, curl and other text mode browsers. Each one will have it's quirks. I suppose curl or wget can be the easier ones to use.

I strongly recommend you to read this article as well as the cron manpage.

share|improve this answer

Edit /etc/crontab and add a line like the following:

0 * * * * root /path/to/executable

Or you can put it in your user crontab by running crontab -e and add the same line but omit the username field.

Of course, as others have said, you can add a script or symlink to /etc/cron.hourly.

share|improve this answer
    
Isn't that one asterik too much? –  acme Jun 24 '13 at 14:11
    
@acme: Fixed, thanks. –  Dennis Williamson Jun 24 '13 at 16:50

Command scheduling with cron. Take a look at /etc/cron.hourly. Everything you place in there will get executed each and every hour.

share|improve this answer

You should be able to find the answer here, though the above comments lay it out nicely already.

share|improve this answer

There's a useful script shipped with nagios which just loads a single web page.

  • Install the nagios-plugins-basic package
  • then put something like this in /etc/cron.hourly

    #!/bin/sh
    /usr/lib/nagios/plugins/check_http -H serverfault.com -u /questions/246048/ > /dev/null
    
share|improve this answer

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