I have the following command to show changes to a subversion repository
svn log -v -r{$(date +%Y-%m-%d)}:HEAD http://therepository | awk '/^r[0-9]+ / {user=$3} {if (user=="username") {print $1 $2 $3}}' | mail -ne -s'Users SVN commits' email@email.com
It works fine in the command line.
When I paste it into a crontab, I get the following error message:
/bin/sh: -c: line 0: unexpected EOF while looking for matching `)'
/bin/sh: -c: line 1: syntax error: unexpected end of file
How does this need to be quoted to work?
When using cron, avoid the hassle of such issues by putting everything into a shell script, then call the shell script from cron.
This approach is commonly used and a good idea because:
For example:
dosomething.sh:
svn log -v -r{$(date +%Y-%m-%d)}:HEAD http://therepository | awk '/^r[0-9]+ / {user=$3} {if (user=="username") {print $1 $2 $3}}' | mail -ne -s'Users SVN commits' email@email.com
plus
cron 0 22 * * * /opt/cron/dosomething.sh