什么是例行性命令

linux工作排程的种类:

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

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

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

仅执行一次的工作排程

linux 基础11-例行性命令

建立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字符的文件

linux 基础11-例行性命令

第二种

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   

linux 基础11-例行性命令

linux 基础11-例行性命令

循环执行的例行性命令

使用者设定:

系统设定:

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-05-07
  • 2021-12-02
  • 2022-12-23
  • 2022-12-23
  • 2022-01-31
猜你喜欢
  • 2021-09-09
  • 2021-06-02
  • 2021-07-22
  • 2021-10-28
  • 2022-12-23
相关资源
相似解决方案