CRON set second execution

CRON cycle plan task

(1) CRONTAB -E creation

* / 1 * * * /Home/user/job.sh

1 6 * * * Echo `Date` >> /Home/user/1.log

After saving, if crontab: installing new crontab occurs

Then, the schedule command has been successful.

Default file save: / var / spool / cron

(2) Task scripts to be executed Job.sh

Echo “Hello”

Echo `date`

(3) Start of CRON service

Test if the CRON service is started:

PS-E | GREP “cron”

/ sbin / service crd Status

/ sbin / service crd Start

/ sbin / service crd Stop

/ SBIN / Service Crond Restart

/ sbin / service crd reload reload configuration

id

Groups user

VI / ETC / SUDOERS

User all = (all) NOPASSWD: ALL

Sudo / Sbin / Service Crond Status

To set CRON to boot:

Add / sbin / service crd Start in /etc/rc.d/rc.local

Cron expression:

* / 5 * * * *? Performed once every 5 seconds

0 * / 1 * * *? Performed once every 1 minute

0 0 23 * *? Performed once 23 o’clock a day

0 0 1 * *? Performed once 1 o’clock a day

0 0 1 1 *? Perform once 1 point per month

0 0 23 l *? Performed once on the last day of the month

0 0 1? * L Perform a week on Sunday to execute once

0 26, 29, 33 * * *? Once 26, 29, 33 points,

0 0 0, 13, 18, 21 * *? Once daily, 13 points, 18 points, 21 points,

Can be implemented with Sleep 30: delay 30 seconds

CRONTAB -E sets the time schedule

crontab -l lists the current schedule

crontab -r deletes the current schedule

Crontab -v lists the status of user cron jobs

/ sbin / chkconfig –List crond

AT command: only execute once

AT 12:00 knocked back to the car, enter the script command, Ctrl + D exit

AT 1:00 2015-11-01

AT Now + 10min

/ var / spool / at

Task query: at -l

Task deletion: ATRM 2

Related Posts