发布新日志

  • crontab的基本用法

    2007-12-25 12:18:03

    格式基本分为6部分,前五个为时间间隔,分别代表(分0-59,时0-23,日1-31,月1-12或英文,星期1-7或英文),最后一个为执行命令。每一部分以空格间隔

    事例:

    */1 * * * * (/home/a/aa/a.sh)

    表示每隔1分钟执行一次

    * 23 * * * (/home/a/aa/a.sh)

    表示在每天23点的每分钟中执行

    30 0-23/2* * * * (/home/a/aa/a.sh)

    表示在每天的0到23点每隔2小时的30分执行

    0 3,9* * * * (/home/a/aa/a.sh)

    表示在每天3点或9点0分执行

    需要注意的是:crontab在执行的时候是不调用系统变量的,所以在sh脚本中建议无论是命令还是文件的存放都用绝对路径

    在实际应用时的一个例子0 2 * * * cd /home/a/aa;./aa.sh > /home/a/aa/aa.log 2>&1

    ;代表在该定时任务执行的时候会先进入到aa路径下,然后在执行该路径下的sh脚本

     > /home/a/aa/aa.log 2>&1 代表如果定时任务执行有问题,会将相关信息输入到log日志中

  • linux系统常用命令(不断维护中。。。)

    2007-10-18 18:35:24

    1.hostname

    常用参数:

    -s, --short           short host name
    -a, --alias           alias names
    -i, --ip-address      addresses for the hostname
    -f, --fqdn, --long    long host name (FQDN)
    -d, --domain          DNS domain name

    2。uname

    常用参数:

    -a, print all information, in the following order:

    -s,  print the kernel name

    -n,  print the network node hostname

    -r, print the kernel release

    -v,  print the kernel version

    -m,  print the machine hardware name

    -p,  print the processor type

    -i, print the hardware platform

    -o, print the operating system

    3。lsb_release

    LSB是Linux Standard Base的缩写,lsb_release命令用来显示LSB和特定版本的相关信息,常用参数-a

    4。whereis

    查找执行命令的所在路径

     

数据统计

  • 访问量: 7997
  • 日志数: 15
  • 建立时间: 2007-09-14
  • 更新时间: 2008-03-25

RSS订阅

Open Toolbar