Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setting up CRON jobs
Message
General information
Forum:
Linux
Category:
Other
Miscellaneous
Thread ID:
00545576
Message ID:
00545635
Views:
8
>I usually use Webmin to do this, but I have a server that needs to be updated before Webmin will install. That said, the same server needs to have the clock adjusted (hardware drifts something awful). This server is on a DSL line and up 24x7.
>
>I am aware of the command
> rdate -s (ip_address_of_time_server)
>for setting the time. What I need is a description of how to set up a cron job to run every 6 to 12 hours and execute the above command. Specifically, I need to know what to enter at a shell prompt.
>
>Any help or pointers greatly appreciated. Thanks!
>
>Mike Copeland

Hi Mike!
All you need to do is, as root, use a text editor (I run KDE and use 'TextEditor' from the menu tree :-) Console folks use pico or vi) to create a text file by what ever name you want (no extension necessary, unless you want to use one) and enter something like this:

#!/bin/bash
rdate -s (ip_address_of_time_server)

and then save it in the /etc/cron/cron_daily subdirectory.
Then, set it's ownership and group to root and turn on the executable bit.
chown root:root
chmod o+x

Or, if you are running KDE, you can use Konqueror like you would Windows Explorer to set the properties and ownership by rightmousing on it and opening the 'properties' menu option.

The cron deamon will automatically execute any file in the cron subdir, based on the name of the cron subdirectory (hourly, daily, weekly, monthly, etc...) and is described in the man pages. Issue 'man cron' in a Xterm and read all about it.
JLK
Nebraska Dept of Revenue
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform