"Linux crontab, start"

Source: Internet
Author: User

First, the scheduled task ATD

The AT command publishes a scheduled task
One-time Task Scheduler

At time Ctrl+d submit
Time
1. Absolute time: 12:00
2. Relative Time: +8
3. Blur Time: Noon Midnight Teatime
-L: View task List equivalent to ATQ
-D #: Undoing a task plan from the task list is equivalent to ATRM
-C #: Display a list of commands in a task


Example: at 11:13
At> mkdir/a/b
at> <EOT> #ctrl +d
Job 4 at 2015-11-21 11:13

If the task does not execute successfully, it receives the message and reads it with the Mail command.

At "2:00 2015-12-01"

ATRM 4, Cancel mission 4th.
At-d 3, Cancel mission 3rd.

CAT/ETC/SYSCONFIG/ATD at configuration file

Date-s "2015-11-21 10:58:00"
Can write hwclock-s in. bashrc_profile

Crond

crontab Command Published task schedule
Recurring Task Schedule
Periodic tasks of the system
/etc/crontab

cat/etc/Crontabshell=/bin/bashpath=/sbin:/bin:/usr/sbin:/usr/binmailto=roothome =/

#For details see Mans 4 Crontabs#Example of job definition:#.----------------minute (0-59)# | .-------------Hour (0-23)# |  | .----------Day of Month (1-31)# |  |  | .-------month (1-12) OR jan,feb,mar,apr ...# |  |  |  | .----Day of Week (0-6) (sunday=0 or 7) or Sun,mon,tue,wed,thu,fri,sat# |  |  |  | |#* * * * * command to be executed(* indicates every minute)

User's personal cycle tasks
Crontab
-E: Edit Scheduled Task (Vim is turned on by default)
-L: Show Scheduled Tasks
-R: Clear Scheduled Tasks

* * * * * */bin/date +%f >/dev/pts/0"Hello root" /dev/pts/0  #  The default is 0 2 * per minute * *             Tenth two o'clock per month. Changes the time, the period moves up one bit. The more numbers, the longer the period 0-10 2 * * * daily two o'clock to two points 10 points,a total of 11 times 0 -10/2 2 * * * Daily two o'clock to two points 10, every two minutes, that is, one minute to execute. 0 points execution, 2 minutes execution ...
Second, start

Startup of Linux Systems
Post-->bios-->bootloader-->kernel-->initramfs-->rootes-->/sbin/init

Post power-on self-test

A BIOS program is stored on the motherboard, which specifies a list of boot orders for the hardware device, bootsequence
Boot sequence set to hard disk first boot, password for BIOS setup
Harddisk
CDROM
Removable
Network
Floppy
Mbr

Bootloader boot launcher, load kernel

Init Run Level
0: Shut down the system (cannot be set to the default run level)
1: Single-user mode 1 s S
2: Multi-user mode, but does not support network file system
3: Full multi-user mode
4: Unused,
5: Graphical interface
6: Re-boot

cat/etc/inittab Default runlevel.  The runlevels used is:#   0-halt (do not set Initdefaultto this)#   1-single User mode#   2-multiuser, without NFS (the same as 3, ifyou don't have networking)#   3-full multiuser mode#   4-unused#   5-x11 c19>#   6-reboot (do not set Initdefault to this)

Chkconfig--level 3 Crond off

To view the current run level
RunLevel
N 3

Who-r
Run-level 3 2015-05-11 06:07

Switching the Run level
Init 0

bootloader Boot Boot Program

Windows:ntldr

Linux:
Lilo:linux Loader
Grub:grand Unified Bootloader

ls/boot/grub/
Device.map ffs_stage1_5 jfs_stage1_5 reiserfs_stage1_5 stage2 xfs_stage1_5
E2fs_stage1_5 grub.conf menu.lst splash.xpm.gz ufs2_stage1_5
Fat_stage1_5 iso9660_stage1_5 minix_stage1_5 stage1 vstafs_stage1_5

Phase 1:446 bytes saved in MBR
Phase 1.5: Saving in the Grub directory
Phase 2: Disk partitioning

Cat/boot/grub/grub.conf

Default=0 #默认选择第一个标题所对应的内核
timeout=5 #当用户不做出选择时, the default wait time, in seconds
if 0 means no user selection, auto-start default title
If 1 means that the system
Splashimage= (hd0,0)/grub/splash.xpm.gz #启动界面的背景图片yum install ImageMagick
Convert will not start unless the user chooses to do so Source.jpg-resize 640x480! -colors xxx.xpm
gzip-9 xxx.rpms

Hiddenmenu #隐藏grub引导菜单 unless the user chooses to display
title Red Hat Enterprise Linux (2.6.32- 71.el6.i686)
Root (hd0,0)
kernel/vmlinuz-2.6.32-71.el6.i686 ro root=uuid= 0f4c5b88-8b5e-4cdb-8c7a-3f1ef4757703
Rd_no_luks RD_NO_LVM rd_no_md rd_no_dm lang=en_us. UTF-8 sysfont=latarcyrheb-sun16 keyboardtype=pc keytable=us nomodeset crashkernel=auto rhgb quiet #内核文件路径及传递给内核的参数
initrd/initramfs-2.6.32-71.el6.i686.img #假根
Boot partition if basic partition
(hd0,0) in grub, all hard drives are HD, the first 0 represents the first hard disk, and the second 0 represents the first partition

at boot startup, if Grub does not have a configuration file or the configuration file is corrupted, the following repair steps are required
Find (hd#,0)/
Root (hd0,0)
Kernel/ vmlinux-2.6.32-71.e16.i686 ro root=/dev/sda3
initrd/initramfs-2.6.32-71.el6.i686.img
Boot

If you mistakenly delete grub, you can use the following command to perform a command-line-level fix
Grub-install--ROOT-DIRECTORY=/BOOT/DEV/SDA

Replicating from another host
SCP 192.168.100.2:/boot/grub/grub

Enter single-user mode during the boot process. Setenforce after 0 to change the root password

Encryption for Grub
Grub-md5-crypt >>/boot/grub/grub.conf
Paste the password before the first titile, the global effect password--MD5 PASSWD

Kernel during the entire startup process, the main features are:
1. Identify the device
2. Load the driver (most likely to use INITRD)
3. Mount the root file system in read-only mode
4. Start the/sbin/init process

Init
/etc/inittab
Upstart
Event-based triggering mechanism

Systemd

Ls/var/lock/subsys Lock File

# chkconfig:345 95 5
# Description:runs commands scheduled by the ' at ' command at the time \

CP 123.sh/etc/init.d/123
chmod +x/etc/init.d/123
Service 123 Start

Chkconfig-updates and Queries RunLevel information for system services

Synopsis
Chkconfig [--list] [--type Type][name]
Chkconfig--add Name
Chkconfig--del Name
Chkconfig--override Name
Chkconfig [--level levels] [--type type] name <on|off|reset|resetpriorities>
Chkconfig [--level levels] [--type type] Name

Chkconfig--add
Chkconfig--del
Chkconfig--list
Chkconfig--level name On|off
Chkconfig name On|off

chkconfig:345 95 5
345: Service needs to be turned on RunLevel, no included RunLevel is off
95: If the service is set to a link, the number of the file that starts with S
5: If the server is set to a link, the number of the file starting with K

Chkconfig--level 3 Crond off

"Linux crontab, start"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.