Moxa IA3341-LX Инструкция по эксплуатации онлайн [30/72] 170917

Moxa IA3341-LX Инструкция по эксплуатации онлайн [30/72] 170917
IA3341 Linux User’s Manual Managing Embedded Linux
3-10
The following example demonstrates how to use Cron.
How to use cron to update the system time and RTC time every day at 8:00.
STEP1: Write a shell script named fixtime.sh and save it to /home/.
#!/bin/sh
ntpdate time.nist.gov
hwclock –-systohc
exit 0
STEP2: Change mode of fixtime.sh
#chmod 755 fixtime.sh
STEP3: Modify /etc/cron.d/crontab file to run fixtime.sh at 8:00 every day.
Add the following line to the end of crontab:
* 8 * * * root /home/fixtime.sh
STEP4: Enable the cron daemon manually.
#/etc/init.d/cron start
STEP5: Enable cron when the system boots up.
By default, cron service is disabled on boot. To enable cron service, please refer to the section
“Enabling and Disabling Daemons” in this chapter

Содержание

Похожие устройства

Скачать