I'm logged in as user pi via SSH and have a wifi checking script wifi_test_1.sh in the following directry:
When i enter the command
/usr/src/scripts/wifi_test_1.sh into the terminal, it runs; i can see the "echos", but when i enter this: */1 * * * * /usr/src/scripts/wifi_test_1.sh into my crontab -e, I can not see it running.
When i do a
grep CRON /var/log/syslog I see:
Feb 24 22:35:01 raspberrypi /USR/SBIN/CRON: (pi) CMD (/usr/src/scripts/wifi_test_1.sh)
But no echos from the script.
Is the script running in the background, so i cannot see the echos from the script, when logged in as pi at terminal via SSH?
script for completeness:
#!/bin/bash # Which Interface do you want to check/fix wlan='wlan0' # perform check if ifconfig $wlan | grep -q "inet addr:" ; then echo "===============" echo "Network is Okay" echo "===============" else echo "=================================================" echo "Network connection down! Attempting reconnection." echo "=================================================" ifdown $wlan sleep 10 ifup --force $wlan ifconfig $wlan | grep "inet addr" fi exit 0