[英]Linux crontab find and email results receiving EOF
when I run a command via command line, it works fine, I get the email with the desired results inside of an attached *.txt file. 当我通过命令行运行命令时,它工作正常,我将在附件* .txt文件中收到包含所需结果的电子邮件。 however, when cron runs this same command, I receive an EOF error.
但是,当cron运行相同的命令时,我收到一个EOF错误。
Can anyone point out what might be causing this error? 谁能指出是什么原因导致此错误?
I am running CPanel on CentOS with Cloudlinux 6.6 我正在使用Cloudlinux 6.6在CentOS上运行CPanel
Here is the email I receive from cron saying it errored; 这是我从cron收到的错误电子邮件;
Subject: Cron <root@whm> find /home/accountname/public_html -type f -mtime -7 2> `date +'
/bin/sh: -c: line 0: unexpected EOF while looking for matching ``'
/bin/sh: -c: line 1: syntax error: unexpected end of file
Here is my command; 这是我的命令;
01 * * * * find /home/accountname/public_html -type f -mtime -7 2> `date +'%m-%d-%Y'`-accountname-filescan.txt | uuencode `date +'%m-%d-%Y'`-accountname-filescan.txt | mail -s "`date +'%m-%d-%Y'`-accountname File Scan Report" root
I'd appreciate any constructive input on what I am doing wrong. 对于在做错事情方面的任何建设性投入,我将不胜感激。
I followed this thread to develop my command; 我遵循此线程来开发命令。 Linux cron job to email output from a command
Linux cron作业通过命令从电子邮件输出
You must escape %: 您必须转义%:
man (5) crontab:
Percent-signs (%) in the command, unless escaped with backslash (\),
will be changed into newline characters, and all data after the
first % will be sent to the command as standard input.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.