Moxa V2616A-C8 [17/111] Cron daemon for executing scheduled commands

Moxa V2616A-C8-CT-W7E [17/111] Cron daemon for executing scheduled commands
V2616A Linux Software Configuration
2-10
# Short-Description: tcps2
### END INIT INFO
. /lib/lsb/init-functions
export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
case "$1" in
start)
start-stop-daemon --start --quiet --oknodo --pidfile /var/run/tcps2.pid --
exec
/usr/sbin/tcps2
;;
stop)
start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/tcps2.pid
;;
esac
exit 0
Then add a service by insserv. If you want to add a service to be started at boot time, you can use:
moxa@Moxa:~# sudo insserv -v -d tcps2
Check the run level with the following command.
moxa@Moxa:~# ls -l /etc/rc?.d/*tcps*
lrwxrwxrwx 1 root root 15 Jul 6 09:40 /etc/rc2.d/S18tcps2 -> ../init.d/tcps2
lrwxrwxrwx 1 root root 15 Jul 6 09:40 /etc/rc3.d/S18tcps2 -> ../init.d/tcps2
lrwxrwxrwx 1 root root 15 Jul 6 09:40 /etc/rc4.d/S18tcps2 -> ../init.d/tcps2
lrwxrwxrwx 1 root root 15 Jul 6 09:40 /etc/rc5.d/S18tcps2 -> ../init.d/tcps2
moxa@Moxa:~#
If you want to remove a service from run-level, you can use this command:
moxa@Moxa:~# insserv -r tcps2
Check the run level removement with the following command.
moxa@Moxa:~# ls -l /etc/rc?.d/*tcps*
ls: cannot access /etc/rc?.d/*tcps*: No such file or directory
moxa@Moxa:~#
CronDaemon for Executing Scheduled
Commands
The Cron daemon will search /etc/crontab for crontab files.
Cron wakes up every minute and checks each command to see if it should be run at that time. 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, issue the following command if you want to launch a program at 8:00 every day:
#minute hour date month dow user command

Содержание

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

Скачать