加入收藏 | 设为首页 | 会员中心 | 我要投稿 佛山站长网 (https://www.0757zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 服务器 > 搭建环境 > Linux > 正文

Linux基础:调查和管理进程

发布时间:2016-10-29 03:31:16 所属栏目:Linux 来源:网络整理
导读:什么是进程? 进程是被载入内存的一个指令集合 进程ID(Process ID,PID)号码被用来标记各个进程 UID、GID相关权限和 SElinux决定对文件系统的存取和访问 通常

没有被重导向的输出会被邮寄给用户

根用户能够修改其它用户的作业

*   The  superuser  may  use  these commands in any case.  For other users, permission to use at is determined by the

*   files /etc/at.allow and /etc/at.deny.

*   If the file /etc/at.allow exists, only usernames mentioned in it are allowed to use at.

*   If /etc/at.allow does not exist, /etc/at.deny is checked, every username not mentioned in it is then  allowed  to

*   use at.

*   If neither exists, only the superuser is allowed use of at.

*   An empty /etc/at.deny means that every user is allowed use these commands, this is the default configuration.

与at有关的配置文件,at.allow,at.deny

at.allow优先级比at.deny的高:

1.先看at.allow,有在里面的用户可以使用at

at.allow不存在时,则检查at.deny,里面的用户不能使用

2.两个文件不存在则只有root才可以使用

一般系统默认只有一个空的at.deny,意味着系统里所有的用户都可以使用at,

两个文件里写用户里一行一个用户

步骤

1、先service atd start|restart

2、at   时间 

时间:at  now + 20 minutes

at  20:39 2013-4-13

回车后,可以输入要执行的命令

输入完成后ctrl+d

atq = at -l   查看

atrm 作业号= at -d   作业号

Crontab文件格式

项目包含五个用空格分隔的字段,然后是要执行的命令

每行一个项目,行的长度没有限制

字段是:分钟、小时、日期、月份、星期几

注释行以#开头

详细参见man 5 crontab的说明书页

与crontab有关的配置文件:cron.allow、cron.deny

1.先看cron.allow,在里面的用户则可以使用crontab

2.没有cron.allow的,检查cron.deny,在里面的不可以使用crontab

3.两个文件都不存在时只有root可以使用

一般系统默认只有一个空的cron.deny,意味着所有人都可以使用

以上两个文件一行一个用户账号

步骤:

1  /etc/init.d/crond  start|restart或者service crond start|restart

2  crontab -e

3  出现的vi编辑器输入要执行的命令,一行一个任务,输入完了:wq保存退出

查看:crontab -l

删除此用户所有任务:crontab -r

只想修改,crontab -e

/etc/crontab

系统自动周期性执行

vim /etc/crontab

SHELL=/bin/sh

MAILTO=paul

# run five minutes after midnight, every day

5 4 3 6 *       $HOME/bin/daily.job >> $HOME/tmp/out 2>&1

# run at 2:15pm on the first of every month -- output mailed to paul

15 */2  1 *   *     $HOME/bin/monthly

# run at 10 pm on weekdays, annoy Joe

查看本栏目更多精彩内容:http://www.bianceng.cn/OS/Linux/

0 22 * * 1-5    mail -s "It’s 10pm" joe%Joe,%%Where are your kids?%

23 0-23/2 * * * echo "run 23 minutes after midn, 2am, 4am ..., everyday"      5 4 * * sun     echo "run at 5 after 4 every sunday"

聚集命令

聚集命令概念:把命令写在一起

有两种聚集命令的方法:

-复合式:date; who | wc –l

  命令会一个接一个地运行

子shell:(date;who | wc –l)>> /tmp/trace

-所有的输出都被发送给单个STDOUT和STDER

(编辑:佛山站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

热点阅读