I have a very frustrating problem involving a crond job. No matter how I issue it (in the crontab file, cron.hourly, ,user crontab, etc) the job executes, writes to my simple log file, but does not do so as it would running from my bash shell or root's bash shell. The command that I am executing is:
/usr/bin/lynx www.dyndns.org -cmd_script=/home/brphelps/ip_stuff/find_ip.txt
This script simply executes lynx with a command script to find my public ip address. The returned string is searched for an ip address, and works great if not run from crond.
I know this is probably not the best way to find a public IP address, but I use a similar lynx command to update the IP address when it is different. Why does it execute differently (incorrectly) under crond's daemon? I am suspicious that it has to with an environment variable but I have not been able to find which one. Any ideas? This will help me to design future crond jobs. Here is my cronjob
file (I use this command to update: # crontab cronjob):
* * * * * /bin/bash /home/brphelps/ip_stuff/job.sh >> /home/brphelps/ip_stuff/logs.txt