Friday, November 27, 2015

My bash script doesn't work in crontab

........Continuing to bash script yesterday..

I got a problem where it doesn't work when it is running using the crontab.

Here is some tips:
1. You can troubleshoot by keep the log of your cron
eg: 10 02 * * * /home/aminah/script.sh  >> /home/aminah/cronscripts.log 2>&1

So, you can tail the cronscripts.log once it is running.

2.  Path of you script.
Make sure you put the full path so that the script will understand where you put the script.

3. If your script is download the files, it will download it at home of your running bash file.
eg: run as root.. the download file will located at /root/


It is really good experience for me... Thanks to Allah swt....

No comments:

Post a Comment