[root@centos001 ~]# cat /etc/crontab SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=root # For details see man 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 # | | | | | # * * * * * user-name command to be executed
0 3 1-10 */2 2,5 /bin/bash /usr/local/sbin/123.sh > /tmp/123.sh >>/tmp/123.log>>/tmp/123. log
注:该服务如不开启,将不会执行计划任务
1.开启服务命令:sytemctl start crond
2.查看服务是否开启命令一:ps aux |grep cron 如有最下的命令 则表示已开启html
[root@centos001 ~]# ps aux |grep cron root 740 0.0 0.1 126232 1676 ? Ss 12月04 0:00 /usr/sbin/crond -n root 6460 0.0 0.0 112676 984 pts/0 S+ 01:11 0:00 grep --color=autocron
3..查看服务是否开启命令二:systemctl status crond
linux
[root@centos001 ~]# ls /etc/init.d/ functions netconsole network README
[root@centos001 ~]# chkconfig --list 注:该输出结果只显示 SysV 服务,并不包含 原生 systemd 服务。SysV 配置数据 可能被原生 systemd 配置覆盖。 要列出 systemd 服务,请执行 'systemctl list-unit-files'。 查看在具体 target 启用的服务请执行 'systemctl list-dependencies [target]'。 netconsole 0:关 1:关 2:关 3:关 4:关 5:关 6:关 network 0:关 1:关 2:开 3:开 4:开 5:开 6:关
[root@centos001 ~]# chkconfig --level 3 network off [root@centos001 ~]# chkconfig --list 注:该输出结果只显示 SysV 服务,并不包含 原生 systemd 服务。SysV 配置数据 可能被原生 systemd 配置覆盖。 要列出 systemd 服务,请执行 'systemctl list-unit-files'。 查看在具体 target 启用的服务请执行 'systemctl list-dependencies [target]'。 netconsole 0:关 1:关 2:关 3:关 4:关 5:关 6:关 network 0:关 1:关[root@centos001 ~]# chkconfig --level 345 network off [root@centos001 ~]# chkconfig --list 注:该输出结果只显示 SysV 服务,并不包含 原生 systemd 服务。SysV 配置数据 可能被原生 systemd 配置覆盖。 要列出 systemd 服务,请执行 'systemctl list-unit-files'。 查看在具体 target 启用的服务请执行 'systemctl list-dependencies [target]'。 netconsole 0:关 1:关 2:关 3:关 4:关 5:关 6:关 network 0:关 1:关 2:开 3:关 4:关 5:关 6:关 2:开 3:关 4:开 5:开 6:关
chkconfig --del network chkconfig --add network
系统为了方便管理用target来管理unit
systemctl list-unit-files --type=target
systemctl list-dependencies multi-user.target //查看指定target下面有哪些unit
systemctl get-default //查看系统默认的target
systemctl set-default multi-user.target
一个service属于一种类型的unit
多个unit组成了一个target
一个target里面包含了多个service
cat /usr/lib/systemd/system/sshd.service //看[install]部分centos
anacron
http://blog.csdn.net/strikers1982/article/details/4787226bash
xinetd服(默认机器没有安装这个服务,须要yum install xinetd安装)
http://blog.sina.com.cn/s/blog_465bbe6b010000vi.html并发
systemd自定义启动脚本
http://www.jb51.net/article/100457.htmssh