I have created one shell script which create backup of mongo and push on bitbucket account.
When I run shell script manually, it works fine. But cronjob does not run
Crontab -
00 01,13 * * * /home/ubuntu/work_area/mongodumps/mongo_backup.sh
Shell script
DIR=`date +%m-%d-%y`
#DEST=/home/ubuntu/Desktop/nitin/mongodumps/$DIR
DEST="/home/ubuntu/work_area/mongodumps"
echo $DEST
#mkdir -p $DEST
mongodump --host localhost --port 17117 -d "db_c2a" -o "$DEST"
git add .
#git commit -m `date +%m%d%y+ autocommit`
git commit -m "Auto commit"+$DIR
git push -u origin master
I checked cron log, it is here
Jan 28 01:00:01 ip-172-31-26-102 CRON[5506]: (root) CMD (/home/ubuntu/work_area/mongodumps/mongo_backup.sh)
Jan 28 01:00:01 ip-172-31-26-102 CRON[5505]: (CRON) info (No MTA installed, discarding output)
Jan 28 01:17:01 ip-172-31-26-102 CRON[5523]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)