Results 1 to 5 of 5
Hi folks,
Ubuntu-6.06.1-LAMP-server-amd64
I have a script.php which is used to update the IP address of my domain on registrar's website. I keep it on /etc/. The IP address of ...
- 12-13-2006 #1Linux Guru
- Join Date
- Sep 2004
- Posts
- 1,531
Dynamic IP and cron job
Hi folks,
Ubuntu-6.06.1-LAMP-server-amd64
I have a script.php which is used to update the IP address of my domain on registrar's website. I keep it on /etc/. The IP address of the server only changes on connection. Please advise how to create a "cron job" which will run the script after booting to update the IP address.
Is /etc/ the right directory for holding the script?
TIA
B.R.
satimis
- 12-13-2006 #2Linux Guru
- Join Date
- Nov 2004
- Posts
- 6,110
The script should probably go into one of the 'bin' folder if it is an executable, unless it is a service/daemon in which case it would go into /etc/rc.d/init.d/ or /etc/init.d/ and then added to the services using the chkconfig command.
To add a cron command log into a terminal as root and use crontab -You then add the job like thisCode:su - crontab -e
Where the asterisks stand for , minute,hour,day-of-month,month,day-of-week - To run it every hour at half past -Code:* * * * * [command]
Check out this wikipedia pageCode:30 * * * * /path/to/your/script.sh
- 12-13-2006 #3Linux Guru
- Join Date
- Sep 2004
- Posts
- 1,531
Hi bigtomrodney,
Tks for your advice and URL.
The script.php was download from the website where I registered the domain. There is a short instruction on the file download instructing running the script.php on cron.
I tried to setup cron with webmin but can't figure out how to set it to run after booting up. Because the IP address of the server only changes on connection. I need to update the IP address on the registrar's website simultaneously.
Tks.
B.R.
satimis
- 12-13-2006 #4Just Joined!
- Join Date
- Mar 2006
- Posts
- 10
I am a noob so beware of my advice

IMO your script should go to your distro's rc.local equivalent because it only need to be run on start up.
Alternatively check out http://ddclient.sourceforge.net/
It should be configured as a service with init script and run at startup.
I would recomment method 2 if your registar supports it.
- 12-14-2006 #5Linux Guru
- Join Date
- Sep 2004
- Posts
- 1,531
Hi yuri_d,
Tks for your advice.
I have ddclient running on this server which is for test purpose. I also have "satimis.homelinux.com" registered with dyndns.com. But I can't get it to work, even unable to ping "satimis.homelinux.com" always pointing at "219.79.144.30", the IP in its Database/DNS asigned to me on registration then hanging.Alternatively check out http://ddclient.sourceforge.net/
It should be configured as a service with init script and run at startup.
I would recomment method 2 if your registar supports it.
$ sudo cat /etc/ddclient.confI spent a week unable to find a solution. Any advice? TIACode:Password: # Configuration file for ddclient generated by debconf # # /etc/ddclient.conf daemon=600 pid=/var/run/ddclient.pid use=web, web=checkip.dyndns.org/, web-skip='IP Address' login=satimis password=xxxxx protocol=dyndns2 server=members.dyndns.org wildcard=YES #use=if, if=eth0 #satimis.homelinux.com example.dyndns.org custom=yes, example.com
B.R.
satimis


Reply With Quote
