Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

crontab to .sh will not run.

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
1885
Posts: 127
Joined: 2014-06-05 04:23

crontab to .sh will not run.

#1 Post by 1885 »

I'm calling a shell script that calls a shell script from crontab and it will not run.
Please throw me a bone. The script is called every minute to test it.

crontab -e
*/1 * * * * /bin/bash -l /home/cwc/bash/pingall.sh

note:
/home/cwc/bash/pingall.sh
runs fine from cli

code for pingall.sh
NOW=$(date +"%Y-%m-%d-%T");
LOGFILE="PING-$NOW.txt";
touch $LOGFILE;
/home/cwc/bash/ping.sh >> $LOGFILE;

code for ping.sh
for ip in $(seq 1 5);
do
ping 192.168.1.$ip -c3;
done

Thanks.

1885
Posts: 127
Joined: 2014-06-05 04:23

Re: crontab to .sh will not run.

#2 Post by 1885 »

removing the touch seemed to help.

NOW=$(date +"%Y-%m-%d-%s");
LOGFILE="log-$NOW.txt";
/home/cwc/bash/ping.sh >> /home/cwc/bash/$LOGFILE;

this was only tested on gentoo

Post Reply