-4

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

Lucas Kauffman
  • 16,880
  • 9
  • 58
  • 93
Belgin Fish
  • 919
  • 5
  • 17
  • 31

4 Answers4

6

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.

coredump
  • 12,713
  • 2
  • 36
  • 56
4

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.

Dennis Williamson
  • 62,149
  • 16
  • 116
  • 151
1

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

jliendo
  • 1,578
  • 11
  • 13
0

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

mgorven
  • 30,615
  • 7
  • 79
  • 122
Kyle
  • 105
  • 2