包裹
cwrap.sh - cron 包装器
每次我写一个要被cron执行的shell脚本,不管这个脚本做什么,我都需要添加代码来保存输出并在它结束后通过电子邮件将状态发送给我。 所以我认为这些操作应该自动化并转移到一个可以处理它们的包装器中。 cwrap.sh 诞生了。
我的脚本现在执行主要任务并将返回代码发送回由 cwrap.sh 处理。
不带参数执行它以显示以下使用消息:
$ ./cwrap.sh
USAGE: cwrap.sh [ options ] script [ script parameters ]
– Executes script at default directory: /tmp
unless script includes directory location
– Redirects output to unique file for each run
评论0
最新资源