crontab中多任务执行

Debug posted @ 2013年3月11日 11:17 in 未分类 , 2179 阅读

首先比较直观是的是把比较复杂的逻辑实现在一个shell脚本,然后在crontab中引用他

echo 'hello world 1';
echo 'hello wordl 2'
* * * * * /path/to/my_script.sh

第二个办法就是直接在crontab配置脚本里面写

* * * * * echo 'hello world 1'; echo 'hello world 2'

值得一说的是,这里的分隔符除了';' 以外,还可以用'&&'和'||', 他们的作用分别是

  • ‘;’:逐条执行命令
  • ‘&&’: 逐条执行,遇到不成功的命令,就中止,后面的不再执行。
  • ‘||’: 逐条执行,遇到成功的命令,就终止,后面的不再执行。
  • 无匹配
dfdf 说:
2019年1月28日 18:52

Engineering as a subject combines mathematics, logic and science to find solutions to our daily life problems. Over the last few decades, engineering as a profession has seen vast expansion.
top engineering college in chandigarh
engineering college in punjab
civil engineering college in chandigarh
Online cgc
top agriculture college in Punjab
Best MBA college in chandigarh

Mark 说:
2019年2月07日 18:08

Our academic pursuits, along with a range of extracurricular activities, help in honing a child's skills and ensuring that he/she grows to be a mature and responsible citizen.
top school in greater noida
premium school in noida

Mark 说:
2019年2月07日 18:08

Our academic pursuits, along with a range of extracurricular activities, help in honing a child's skills and ensuring that he/she grows to be a mature and responsible citizen.
top school in greater noida
premium school in noida

Vig 说:
2019年2月07日 18:09

Moonlight Films and Theatre Studio operates under the Moonlight Films and Theatre Society , a non-profit association whose goals are to spread knowledge of and interest in theatrical and media arts through education.
Acting school in mumbai
Acting classes in delhi

dfdf 说:
2019年2月07日 18:43

Apple products are revered for its quality, precision and great design. SRSG started its operations as Apple technology partners in the year 1997.
Apple reseller in Kolkata
Broadcast consultancy
Apple authorized service center in delhi
MacBook Air reseller in ahmedabad
ipad reseller bhubaneswar

Gos 说:
2019年4月23日 19:41

School believe in the individuality and unique identity of each child, and our educational philosophy is emphatic about providing a child-centric education through a unique curriculum.
Play school in hisar
popular school in hisar
And
best hospital in hisar
test tube baby hospital in hisar

Gos 说:
2019年4月23日 19:41

School believe in the individuality and unique identity of each child, and our educational philosophy is emphatic about providing a child-centric education through a unique curriculum.
Play school in hisar
popular school in hisar
And
best hospital in hisar
test tube baby hospital in hisar

ahc 说:
2019年7月18日 15:25

multiple learning environment of International standard with holistic system of education at an affordable cost for the successful life of young generation.
Paramedical college north india
top agriculture college in dehradun
agriculture college in north india
bachelor of science in microbiology in dehradun

dcb 说:
2019年8月14日 15:32

Welcome to the world of gaming, where life is fast paced and interesting. There is always an adventure waiting for you online.
buy csgo accounts
csgo ranks


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter