1、 Red Hat的发行版本中,通常还可以使用工具ntsysv设置服务的自启动状态。 #类似chkonfig 服务名 on|off

2、系统服务脚本目录:/etc/init.d

3、ps:

-a:显示所有终端进程;

-u:显示所有用户进程;

-x:显示所有进程,包括没有明确终端的进程;

-e:显示所有进程。与x类似,但是用BSD系统格式;

-f:显示UID,PPID(父进程ID)。。。;

-l:以长格式显示进程列表;

4、top:实时显示进程:

P:按CPU使用率由高到低排序;

M:按内存占用率排序;

h:查看帮助信息;

5、nice:查看默认进程优先级:(进程一般默认为0,一共四十个等级。-20到19)

-n:指定命令或者程序的优先级;

renice -n PID:改变进程优先级;

6、两个系统服务crond atd

crontab

备份以及恢复计划任务:

 crontab -l > root_cron

 crontab -r

5 crontab root_cron

 crontab -l

7、

root可以看wlh的计划任务:

crontab -u wlh -l

默认情况下,系统会把提交的计划任务放在目录/var/spool/cron

限制某个用户在 /etc/cron.deny 添加用户名

8、

系统计划任务:

用ls命令查看系统中的计划任务目录:

 root@ubuntu:/home/dyx :: # ls -ld /etc/cron* | grep "^d"
drwxr-xr-x root root Jul : /etc/cron.d
drwxr-xr-x root root Jul : /etc/cron.daily
drwxr-xr-x root root Aug /etc/cron.hourly
drwxr-xr-x root root Aug /etc/cron.monthly
drwxr-xr-x root root Jan /etc/cron.weekly

运行的这些文件在:

/etc/crontab:

#Centos中:
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/ # run-parts
* * * * root run-parts /etc/cron.hourly
* * * root run-parts /etc/cron.daily
* * root run-parts /etc/cron.weekly
* * root run-parts /etc/cron.monthly #Ubuntu中:
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do. SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin # m h dom mon dow user command
* * * * root cd / && run-parts --report /etc/cron.hourly
* * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
* * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
* * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
#
*****cactiuser php5 /var/www/cacti/poller/php>/dev/null >&

9、

at:一次性计划任务:

-f:指定一个文件作为任务脚本;

-m:完成任务之后给用户发送一个邮件;

-l:列出计划任务表

-d:删除指定的计划任务

 root@ubuntu:/etc :: # at now + minute  #之后按enter
warning: commands will be executed using /bin/sh
at> date >> /home/dyx/date.txt
at> <EOT>                       #按Ctrl+D 结束输入
job at Wed Jul ::
 root@ubuntu:/home/dyx/linux :: # at now + minute -f /home/dyx/linux/helloword.sh
warning: commands will be executed using /bin/sh
job at Wed Jul ::

放在目录:/var/spool/at

限制某个用户:/etc/at.deny 添加用户名字

10、

日志守护进程syslogd

配置文件:/etc/syslog.conf

linux中crontab和at的更多相关文章

  1. AIX 与Linux 中crontab 介绍

    AIX 与Linux 中crontab 用法相似,先介绍Linux 中的Crontab 用法,再后介绍AIX 与Linux 的不同之处.   一.Crontab 介绍 crontab命令的功能是在一定 ...

  2. Linux中crontab无法执行java程序的问题

    Linux中crontab无法执行java程序的问题 jdk环境变量配置问题:可以用全路径来解决: 竟然是kill -9之后,后面的脚本都不运行,这个还没有找到原因啊: 即便是系统级别的 ls 命令, ...

  3. Linux 中 crontab 详解及示例

    cron是一个linux下的定时执行工具,可以在无需人工干预的情况下运行作业.由于Cron 是Linux的内置服务,但它不自动起来,可以用以下的方法启动.关闭这个服务: /sbin/service c ...

  4. linux中crontab命令

    一.crond简介 crond是linux下用来周期性的执行某种任务或等待处理某些事件的一个守护进程,与windows下的计划任务类似,当安装完成操作系统后,默认会安装此服务工具,并且会自动启动cro ...

  5. Linux中crontab下scp文件传输的两种方式

    Linux下文件传输一般有两个命令scp.ftp(工具需要下载安装) 本文主要讲讲scp的文件传输脚本 1.scp ssh-keygen -t rsa免输入密码,传输 这里假设主机A 用来获到主机B的 ...

  6. Linux中Crontab的使用

    一.安装依赖 yum install cronie 二.添加 Crontab crontab -e 三.查看crontab内容 crontab -l 其中常见的一些内容 例子: # 每月的最后1天 0 ...

  7. Linux中Crontab的用法

    1.crontab的概念: crontab命令用于设置周期性被执行的指令.该命令从标准输入设备读取指令,并将其存放于"crontab"文件中,以供之后读取和执行.可以使用它在每天的 ...

  8. Linux中crontab的坑爹环境变量问题

    手动在CentOS中执行sh脚本,调用java程序,一切正常: 将该sh加入crontab中定时调度之后,挂了,完全没有执行到的感觉啊!!! 查看crontab执行日志: cat /var/log/c ...

  9. linux中crontab的使用方法

    crontab参数说明: -e : 执行文字编辑器来设定时程表,内定的文字编辑器是 VI,如果你想用别的文字编辑器,则请先设定 VISUAL 环境变数来指定使用那个文字编辑器(比如说 setenv V ...

随机推荐

  1. android 解释dp,px,pt,sp单位

    1.dp(dip):不同设备有不同的显示效果,这个和设备硬件有关系,一般我们为了支持WVGA,HVGA和QVGA对剑使用这个,它是不依赖像素的 2.px:pixels(像素),不同设备显示效果相同,一 ...

  2. 用html5的canvas生成图片并保存到本地

    原文:http://www.2cto.com/kf/201209/156169.html 前端的代码: [javascript]  function drawArrow(angle)  {      ...

  3. Lazy Loading Images

    Use a blank.gif as the src of images, and include the width and height of the final image. HTML: < ...

  4. Android编程之仿微信显示更多文字的View

    微信朋友圈中,如果好友发表的文字过长,会自动收缩起来,底下有提示,当点击“显示更多”时才会展开. 首先定义布局文件(很简单,不解释): <?xml version="1.0" ...

  5. hadoop学习笔记之倒排索引

    开发工具:eclipse 目标:对下面文档phone_numbers进行倒排索引: 13599999999 1008613899999999 12013944444444 13800138000137 ...

  6. cdoj 1143 传输数据 最大流

    传输数据 Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.uestc.edu.cn/#/problem/show/1143 Descri ...

  7. php实现工厂模式

    设计模式-使用php实现工厂方法模式 [概要] 创建型模式 定义一个用于创建对象的接口,让子类决定实例化哪一个类.Factory Method使用一个类的实例化延迟到其子类[GOF95] [结构图] ...

  8. Chrome 开发者工具使用技巧

    最近我花了较多的时间使用 Chrome 的开发者工具.我发现了很多之前没用过的好功能 (或还不是特别需要用到的功能,例如 blackboxing 和 asynchronous stacktraces) ...

  9. HDU1003 Max Sum(求最大字段和)

    事实上这连续发表的三篇是一模一样的思路,我就厚颜无耻的再发一篇吧! 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1003 -------------- ...

  10. Java HttpClient使用小结

    httpclient是apache的一个项目:http://hc.apache.org/ 文档比較完好:http://hc.apache.org/httpcomponents-client-ga/tu ...