Linux OPS Practice-September 5, 2015 Course Assignment (practice) Schedule
Task Scheduler
perform a task at a time in the future at batch
perform a task periodically crontab
Email Service
smtp:simple Mail Transfer Protocol Simple Mail Transfer Protocol
Pop3:post Office Protocal 3 Post Office Protocol version 3
imap4:internet Mail Access Protocol Interactive Data messaging protocol
Mail
mail-s ' SUBJECT ' [email protected]
mail-s ' SUBJECT ' [email protected] </path/from/somefile
Time
1. Absolute time
hh:mm,
2. Relative Time
Now+minute,hour,day,week
3. Blur Time
Midnight
At Command
Common options:
- q queue:at job queue;
-f/path/from/somefile: Reads the job to be run from the specified file;
-L: View a list of such running jobs in the job queue; equivalent to using the ATQ command;
C At_job_num: Look at the contents of the running job;
- D: Delete the specified job; equivalent to ATRM
Batch: The system chooses to run the specified task when the resource is idle
crontab
1. System cron Task: No default running user identity, need to specify run identity
/etc/crontab
2. User Cron Task: Submitted by a user, run by default, no need to specify the runner
/var/spool/cron/username
Recommended crontab Command
Job
1. Every Monday to Saturday 3:20 A.M., run the CP command to save the/etc/directory, storage location is/backups/etc-yyyy-mm-dd;
3 * * 1-6/bin/cp-rfp/etc//backups/etc-' Date +\%y\%m\%d '
2. Every Sunday 2:30 A.M., run the CP command to back up the/etc/fstab file with a storage location of/backup/fstab-yyyy-mm-dd-hh-mm-ss
2 * * 7/bin/cp-rfp/etc/fstab/backups/fstab-' date +\%y\%m\%d\%h\%m\%s '
3. Every Monday to Saturday 3:20 A.M., run the CP command to save the/etc/directory, storage location is/backups/etc-yyyy-mm-dd;
* * * * /bin/echo ' =============== ' >>/statistics/meminfo.txt
0 0 * * */bin/egrep ' ^ (s| M) '/proc/meminfo >>/statistics/meminfo.txt
This article is from the "Small Togo" blog, please be sure to keep this source http://icestick8586.blog.51cto.com/9867871/1692680
Linux OPS Practice-September 5, 2015 Course assignments (practice) Schedule