Moxa DA-681-I-SP-LX [20/65] Cron daemon for executing scheduled commands

Moxa DA-681-I-DP-LX [20/65] Cron daemon for executing scheduled commands
DA-681 Linux Software Configuration
2-9
MOXA:~# cd /etc/rc2.d
MOXA:/etc/rc2.d#
MOXA:/etc/rc2.d# ls
S19nfs-common S25nfs-user-server S99showreadyled
S20snmpd S55ssh
S24pcmcia S99rmnologin
MOXA:/etc/rc2.d#
MOXA:/etc/rc2.d# ln s /root/tcps2-release S60tcps2
MOXA:/etc/rc2.d# ls
S19nfs-common S25nfs-user-server S99rmnologin
S20snmpd S55ssh S99showreadyled
S24pcmcia S60tcps2
MOXA:/etc/rc2.d#
The command SxxRUNFILE has the following meaning:
S: Start the run file while Linux boots up.
xx: A number between 00-99. The smaller number has a higher priority.
RUNFILE: The script file name
The command KxxRUNFILE has the following meaning:
K: Start the run file while Linux shuts down or halts.
xx: A number between 00-99. The smaller number has a higher priority.
RUNFILE: The script file name
To remove the daemon, remove the run file from /etc/rc2.d by using the following command:
# rm f /etc/rc2.d/S60tcps2
After you finish writing or modifying the code, remember to execute “umount /” to change the root directory
back to Read-only mode.
MOXA:~# umount /
CronDaemon for Executing Scheduled
Commands
The Cron daemon will search /etc/crontab for crontab files, which are named after accounts
in /etc/passwd.
Cron wakes up every minute and checks each command to see if it should be run in that minute. When
executing commands, output is mailed to the owner of the crontab (or to the user named in the MAILTO
environment variable in the crontab, if such a user exists).
Modify the file /etc/crontab to set up your scheduled applications. Crontab files have the following format:
mm h dom mon dow user command
minute hour date month week user command
0-59 0-23 1-31 1-12 0-6 (0 is Sunday)
For example, if you want to launch a program at 8:00 every day
#minute hour date month week user command
* 8 * * * root /path/to/your/program
The following example demonstrates how to use Cron to update the system time and RTC time every day at
8:00.

Содержание

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

Скачать