zoukankan      html  css  js  c++  java
  • linux 基础11-例行性命令

    1. 什么是例行性命令

    1.1 linux工作排程的种类:

    linux例行性命令主要有两种:

    • at:仅执行一次就从linux的任务中取消
    • cron:将持续例行性的工作下去

    1.2 系统常见的例行性命令有哪些:

    2. 仅执行一次的工作排程

    建立date.sh
    #!/bin/bash
    #program: this program to show time like: yyy-mm-dd hh-mm-ss AM/PM
    #history:
    #2009-10-07 first realease lin xiyu

    PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
    echo "Today is 'date +%F %r'"
    

    给test1用户发送邮件
    at 16:57
    at>/bin/mail -s "'/bin/bash /root/date.sh'" test1
    at>
    job 48 at 2009-10-07 16.57

    ls -ls /var/spool/at  #显示该目录下的at例行性命令
    
    mail #在test1用户中查询邮件
    t 1  #全部显示第一封邮件
    x  #退出
    
    
    ls /etc/ | grep at  #显示/etc目录下所有含有at字符的文件
    

    第二种

    vi t1.txt
    at 17:05 2009-10-07
    at>/bin/mail -s "'/bin/bash /root/date.sh'" test1<t1.txt
    at> <EOT> 
    job 48 at 2009-10-07 17:05    
    

    第三种和-m的解释

    at -m 05:07pm october 7
    at>/bin/mail -s "'/bin/bash /root/date.sh'" test1<t1.txt
    at> <EOT> 
    job 48 at 2009-10-07 17:05   
    

    第四种:

    at -m now + 1 minute
    at>/bin/mail -s "'/bin/bash /root/date.sh'" test1<t1.txt
    at> <EOT> 
    job 48 at 2009-10-07 17:05   
    

    3. 循环执行的例行性命令

    3.1 使用者设定:

    3.2 系统设定:

  • 相关阅读:
    DataGrid
    取整、取小数点位数
    如何跨浏览器使用连续字符的换行
    如何给 legend 标签设定宽度
    25个简洁优美的网站设计
    重新发现HTML表格
    用户研究角度看设计(2):用户为何视若无睹
    lineheight 属性的继承问题
    jQuery技巧总结
    web2.0网站配色方案
  • 原文地址:https://www.cnblogs.com/agui125/p/10056399.html
Copyright © 2011-2022 走看看