CRONTAB语法错误 [英] CRONTAB syntax error

查看:76
本文介绍了CRONTAB语法错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Herer是我的CRONTAB文件(Ubuntu 10.10):

Herer is my CRONTAB file (Ubuntu 10.10):

57 1 * * 2-6  ET=`date --date 'yesterday'+%Y%m%d`;echo $ET

Even语法颜色表示出事了并且出现此错误:

Even The syntax color indicate that something is wrong. and there is this error:

Subject: Cron <root> ET=`date --date 'yesterday' + (failed)
Content-Type: text/plain; charset=ANSI_X3.4-1968
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=root>

/bin/sh: Syntax error: EOF in backquote substitution

我不知道怎么了。非常感谢!

But I am not sure whats wrong. Thanks a lot!

推荐答案

Cron需要转义%符号- http://www.hcidata.info/crontab.htm

Cron needs to escape the % sign - http://www.hcidata.info/crontab.htm

尝试使用反斜杠:

57 1 * * 2-6  ET=`date --date 'yesterday' +\%Y\%m\%d`;echo $ET

这篇关于CRONTAB语法错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆