How can I setup a cron job in debian to run a certain url once every hour. There`s no control panel or anything.
Asked
Active
Viewed 4,309 times
-4
-
2Same as on every other distro. – Ignacio Vazquez-Abrams Mar 11 '11 at 04:20
-
where`s the file located – Belgin Fish Mar 11 '11 at 04:22
4 Answers
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