I am struggling to create a cron job since morning. Here is the process I did.
The task I am trying to run management.sh
,
#!/bin/bash
cd /var/www/mysite.com/myproject/
source ../venv/bin/activate
python manage.py dbbackup
deactivate
I made this script executable by doing
sudo chmod +x /var/www/mysite.com/myproject/management.sh
.Then with
crontab -e
I added the following line to run every 2 mins.*/2 * * * * /usr/bin/sh /var/www/mysite.com/myproject/management.sh >> /var/log/cron.log 2>&1
Problem
sudo tail -f /var/log/syslog | grep CRON
, this is what I see,
Jul 26 09:52:01 test-svr-loc1 CRON[23583]: (dexter) CMD (/usr/bin/sh /var/www/mysite.com/myproject/management.sh >> /var/log/cron.log 2>&1)
Jul 26 09:52:01 test-svr-loc1 CRON[23582]: (CRON) info (No MTA installed, discarding output)
When I check the cron.log
, it is empty.
What is wrong here?