-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,818
  • 9
  • 57
  • 92
Belgin Fish
  • 909
  • 5
  • 17
  • 30

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,573
  • 2
  • 34
  • 53
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
  • 60,515
  • 14
  • 113
  • 148
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,568
  • 11
  • 13
0

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

mgorven
  • 30,036
  • 7
  • 76
  • 121
Kyle
  • 105
  • 2