linux - Why I'm getting unexpected EOF while looking for matching `'' for my cron job? -


/bin/sh: -c: line 0: unexpected eof while looking matching `'' /bin/sh: -c: line 1: syntax error: unexpected end of file 

here's cron job:

*/1 * * * * aide --check | echo  "start timestamp: `date +'%y-%m-%d %h:%m:%s'`" > /var/log/aide/aide2.log 

this because % sign treated specially in crontab. those, if needed literally have escaped \ here quote manpage:

the ``sixth'' field (the rest of line) specifies command run. entire command portion of line, up newline or % character, executed /bin/sh or shell specified in shell variable of crontab file. percent-signs (%) in command, unless escaped backslash (\), changed newline characters, , data after first % sent command standard input. there no way split single command line onto multiple lines, shell's trailing "\".

however, wrar pointed, pipe makes no sense. wanted || there instead of |.


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

python - pip wont install .WHL files -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -