Crontab & NTP

 

1.   Start

1.1.          Target: Synchronizing the date in client with server at 6:05 everyday.

1.2.          NTP Server: 192.168.1.10

1.3.          NTP Client: RHEL 5.8

1.4.          Software: crontab

2.   Operation in client

2.1.          #service ntpd stop

2.2.          #chkconfig –level 23456 ntpd off

2.3.          #vi /etc/crontab

Ø  Source

SHELL=/bin/bash

PATH=/sbin:/bin:/usr/sbin:/usr/bin

MAILTO=root

HOME=/

 

# run-parts

# 01 * * * * root run-parts /etc/cron.hourly

# 02 4 * * * root run-parts /etc/cron.daily

# 22 4 * * 0 root run-parts /etc/cron.weekly

# 42 4 1 * * root run-parts /etc/cron.monthly

 

Ø  Destination

SHELL=/bin/bash

PATH=/sbin:/bin:/usr/sbin:/usr/bin

MAILTO=root

HOME=/

 

# run-parts

05 06 * * * root /sbin/ntpdate 192.168.1.10 >> /var/log/date.log 2>&1

# 01 * * * * root run-parts /etc/cron.hourly

# 02 4 * * * root run-parts /etc/cron.daily

# 22 4 * * 0 root run-parts /etc/cron.weekly

# 42 4 1 * * root run-parts /etc/cron.monthly

 

2.4.          #service crond restart

 

Done.

你可能感兴趣的:(crontab,ntp)