Set boot service knowledge:
chkconfig - level 35 service name on: set the boot time of service.
/ Etc / at.allow and / etc / at.deny these two files to be carried out at the use restrictions. Some users want to have at it, that user's account will be written to / etc / at.deny can be! An account written line.
at [-m] TIME, make / var / spool / at directory under the actual operation of the work is, we must start our atd the services mentioned above, parameters:
-M: at work when completed, to notify the user that the email's work has been completed.
TIME: time format, where you can define 『when』 to conduct this work at the time, the format are:
HH: MM ex> 04:00
In today's HH: MM time for, if the time has exceeded, the future of HH: MM to make this work.
HH: MM YYYY-MM-DD ex> 04:00 2005-12-03
Mandatory for a certain period in one day to carry out the work of a special moment!
HH: MM [am | pm] [Month] [Date] ex> 04pm December 3
Is the same force in a certain period of time for a certain day!
HH: MM [am | pm] + number [minutes | hours | days | weeks]
ex> now + 5 minutes ex> 04pm + 3 days
That is, at some point 』『 together only for a few time.
Example one: in five minutes, will be / root / .bashrc to send dmtsai this user
[Root @ linux ~] # at now + 5 minutes
at> / bin / mail dmtsai-s "testing at job" </ root / .bashrc
at> <EOT> <== here to enter the [ctrl] + d will appear <EOF> words! On behalf of the end!
job 8 at 2005-09-07 10:47
# Information in the description above this line, the first 8 at the work carried out in 2005/09/07 to 10:47!
Example two: the computer room power outage is expected to 2005/09/16, 2005/09/15 23:00 I want to shut down?
[Root @ linux ~] # at 23:00 2005-09-15
at> / bin / sync
at> / bin / sync
at> / sbin / shutdown-h now
job 10 at 2005-09-15 23:00
# You to see! at work can also enter a number in a command it! Right!
atq: check how much above the current host at the Task Scheduler.
atrm [jobnumber]: exclusion scheduling, first with the atq view the schedule ID, and then excluded from the schedule this command.
chkconfig command is used to update and query the different services running on the system level, the syntax is:
chkconfig - list [name]
chkconfig - add name
chkconfig - del name
chkconfig [- level levels] name
chkconfig [- level levels] name.
chkconfig has five functions: to add services, remove services, list services, change the boot information and check the status of a particular service starts.
- Level levels run level specified by the numbers 0 to 7 constitute the string, such as:
- Level 35 that specify the run level 3 and 5. To run level 3,4,5 in the nfs service outage, use the following command: chkconfig - level 345 nfs off
- Add name This option adds a new service, chkconfig to ensure that each class has a running start (S) or kill (K) entry. If missing, will be the default init script from automatically created.
- Del name to remove the service, and the related symbolic link from / etc / rc [0-6]. D deleted.
- List name list, if you specify the name you specified service name is displayed, otherwise, list all the services running on different levels of state.
Different operating levels are defined as follows:
# 0 - stop (Do not put initdefault is set to 0)
# 1 - Single user mode # s init s = init 1
# 2 - Multiuser, without NFS
# 3 - Full multi-user mode (standard operating level)
# 4 - unused # 5 - X11 multi-user graphical mode (xwindow)
# 6 - reboot (Do not set the initdefault 6)
Run-level files, each managed by chkconfig service needs under the corresponding init.d script with the two lines or more lines of comments.
The first line tells chkconfig to start the default run level and start and stop priority. If a service is not in any of the default run level starts, use - instead of run level.
The second line of the service description, you can use cross-bank notes.
For example, random.init contains three lines:
# Chkconfig: 2345 20 80
# Description: Saves and restores system entropy pool for
# Higher quality random number generation.
Show that the random script should be run level 2, 3, 4, 5, start, start priority 20 and stop priority of 80.
1, to install the apache service linux (compiled by downloading a binary file to install the economy, not the rpm package), apache service start command: / usr / local / apache / bin / apachectl start, so that apache service is running in run level 3 the following .
Command as follows:
1) touch / etc / rc.d / init.d / apache
vi / etc / rc.d / init.d / apache
chown-R root / etc / rc.d / init.d / apache
chmod 700 / etc / rc.d / init.d / apache
ln-s / etc / rc.d / init.d / apache / etc/rc.d/rc3.d/S60apache
# S is the start of the short, on behalf of start, K is the kill shorthand, representing close. Number represents the order of 60 starts (for iptv systems, many services built on the premise of the database before starting the normal start, and can be adjusted by the number of scripts on the boot sequence.)
#! / Bin / bash
# Start httpd service
/ Server / apache / bin / apachectl start.
Run Time Knowledge:
crontab: user settings, security issues, and at the same, we can restrict the use of crontab user account, allowed and prohibited uses and at similar. When you use Task Scheduler to create after the crontab, it will be recorded to / var / spool / cron / in.
crontab [-u username] [-l |-e |-r], parameters:
-U: only root can be carried out this task, that is to help other users to create / remove the crontab;
-E: edit the contents of crontab job
-L: access to the contents of crontab job
-R: remove crontab job content.
Example One: 12:00 every day with dmtsai sent letters to their
[Dmtsai @ linux ~] $ crontab-e
# At this time will enter the vi editor screen allows you to edit the work! Noted that each job is his party.
0 12 * * * mail dmtsai-s "at 12:00" </ home / dmtsai / .bashrc.
Minute hour date month representational figures range 0-59 weeks 0-231-311-12 0-7.
Represent the meaning special characters accepted on behalf of any meaning at all times! For example, one example of the table, that day, month, week are * to
『Represents both what month and what day of the week follow-up of several commands are executed at 12:00』 mean!
Representative of the meaning of separation in time. For example, if the work to be issued is 3:00 and 6:00, it will be:
0 3,6 * * * command
There are five columns, but the second column is 3,6, 3 and 6 are applicable to the representative!
Representatives within a period of time, for example, between 8 am to 12 points are 20 points per hour to conduct a public
20 8-12 * * * command
Carefully to see the second column into a 8-12 Oh! Are applicable to the meaning of the representative 8,9,10,11,12!
That n represents a number, that is, every n unit interval 』『 means, for example, once every five minutes, then:
* / 5 * * * * command
Very simple! With * and / 5 to match, you can also write 0-59/5, same meaning!
Time is running PHP files: 0 6 * * * / usr / local / php / bin / php / usr / local / apache / htdocs / test / timer.php>> / tmp / cron.log.
Running in the background: / usr / local / php / bin / php CopyBaseToFile.inc.php &.
Continue after the closure of the terminal running in the background: nohup / usr / local / php / bin / php CopyBaseToFile.inc.php &.