The following cron job fails to execute. What's wrong with it? It works fine when I run it directly from the shell prompt.
www-data@etl:~$ crontab -l
SHELL=/bin/bash
MAITO=""
0 5 * * * export YESTERDAY=$(date --date "yesterday" "+%Y-%m-%d"); cd /var/www/project && source .env/bin/activate && ./manage.py get_orders --date="$YESTERDAY" && sleep 5m && time ./manage.py merch --date="$YESTERDAY" && time ./manage.py order_flat_report --date="$YESTERDAY" && time ./manage.py update_hourly_report --date="$YESTERDAY"
I'm getting this error message:
Return-Path: <www-data@etl>
X-Original-To: www-data
Delivered-To: www-data@etl
Received: by localhost (Postfix, from userid 33)
id E170C43EC7; Fri, 18 Apr 2014 05:00:01 -0400 (EDT)
From: root@etl (Cron Daemon)
To: www-data@etl
Subject: Cron <www-data@etl> export YESTERDAY=$(date --date "yesterday" "+
Content-Type: text/plain; charset=ANSI_X3.4-1968
X-Cron-Env: <SHELL=/bin/bash>
X-Cron-Env: <MAITO=>
X-Cron-Env: <HOME=/var/www>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=www-data>
Message-Id: <20140418090001.E170C43EC7@localhost>
Date: Fri, 18 Apr 2014 05:00:01 -0400 (EDT)
/bin/bash: -c: line 0: unexpected EOF while looking for matching `"'
/bin/bash: -c: line 1: syntax error: unexpected end of file
- Ubuntu 13.10 (GNU/Linux 3.11.0-14-generic x86_64)
- GNU bash, version 4.2.45(1)-release (x86_64-pc-linux-gnu)