Periodical program execution – SENA SS800 User Manual

Page 102

Advertising
background image

102

8.8.2. Periodical Program Execution

User can use crontab to execute a specific program periodically. To enable periodical jobs using

crontab

, please complete following steps,

Step 1 Create a crontab file on /usr2 directory. Following sample crontab file generates

current_date

file under /tmp directory and revise its contents every 2 minutes.

SHELL=/bin/bash
# Sample crontab job
# Run every two minutes
* * * * * echo `date` > /tmp/current_date

Step 2 Register crontab file using following command.

root@SS800_Device:/usr2# crontab samplecrontab_file

Step 3 To make cron job permanent for every system reboot, please use rc.user script as

follows:

#!/bin/bash
#
# rc.user : Sample script file for running user programs at boot time
#

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

# Add shell command to execute from here
crontab /usr/samplecrontab_file

exit 0

Please note that –e option (editing current crontab using editor) is not supported in Super Series. So

user must user vi editor to change contents in crontab file.

For more information about the format of crontab file, please refer to Linux crontab manual(man 5

crontab

).

Advertising