Hi,
My goal is find and write ip address with crontab
here is my script
findip.sh
#!/bin/bash
echo "myip:"
ifconfig eth0 | grep inet | grep -v inet6 | awk '{print $2}' > ip.txt
here is cron (create : crontab -e)
*/1 * * * * /root/findip.sh
I am run findip.sh with ssh terminal. Everythings working. I saw ip address ip.txt
myip
192.168.0.111
But whan ip.txt create with cron there is no ip. address only
myip:
what is the problem?
Thanks for help.
Oki