I have a bash script where I run a while/read/do/done loop that is fed off of a text file with 200+ values in it. I have this bash script set on my cron to run three times per morning. I am running into an issue where the while read loop is not finishing reading line-by-line the text file. I have included all relevant code below. I am currently using Ubuntu 16.04 LTS Desktop.

What could be causing this?

Bash Script Code:

while read point; do

  echo "${point}"

done < /home/admin/site_list

site_list File (Sample):


crontab job:

07 6 * * * time /home/admin/all.sh > /home/admin/logs/all1.log1 2>&1
08 10 * * * time /home/admin/all.sh > /home/admin/logs/all1.log2 2>&1 
14 13 * * * time /home/admin/all.sh > /home/admin/logs/all1.log3 2>&1 

You probably should redirect stderr of time /home/admin/all.sh into the log file or some other file. My guess is that you're missing the error message. crond typically emails any stdout or stderr output to the owner of the cron job. I can't tell from your info what user ID that is: might be root. Check the email on that machine for emails from crond to see what that says.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.