Koozali.org: home of the SME Server

How to run ipcheck as a cron job

Kingnubian

How to run ipcheck as a cron job
« on: December 10, 2002, 04:14:30 AM »
I have created a cron job for running ipcheck to check for changes in my IP address every 15min. I used crontab -e and entered the following line;

15 * * * * python  /home/e-smith/files/users/kingnubian/home/ipcheck -l -r checkip.dyndns.org:8245 xxxxxxx xxxxxxxx xxxxxxx

It is not working as my ip did change today and no update happened. I also notice that when the server is booting that a message flashes by saying something to the effect of "Unable to execute" or something like that pertaining to this same cron job. Have I done something wrong and if so what and how to correct the error?

Jon Blakely

Re: How to run ipcheck as a cron job
« Reply #1 on: December 10, 2002, 05:09:32 AM »
What do the cron logs say?

what happens if you run

python /home/e-smith/files/users/kingnubian/home/ipcheck -l -r checkip.dyndns.org:8245 xxxxxxx xxxxxxxx xxxxxxx

manually?

is ipcheck permissions excecutable?

is'nt it ipcheck.py or have you renamed it.

Jon

Kingnubian

Re: How to run ipcheck as a cron job
« Reply #2 on: December 10, 2002, 06:33:21 AM »
I ran the file manually and it with the line above and it said "dat file not found" so I ran with the --makedat and it seemed to work, creating a dat file under /root. Permissions wise it is set as owned by kingnubian but I changed that to "execute by others".

BTW, I am sorry but the line should have read ipcheck.py. I  made a mistake when I made the post but not when I made created the crontab.

Jon Blakely

Re: How to run ipcheck as a cron job
« Reply #3 on: December 10, 2002, 07:11:42 AM »
Yes, you need the dat file as it stores the last known ip address and ipcheck.py checks this against the one it greps from checkip.dyndns.org. If it has changed it updates dyndns otherwise it leaves it alone.

Check your cron logs to make sure it is running ok.

Jon

Kingnubian

Re: How to run ipcheck as a cron job
« Reply #4 on: December 10, 2002, 08:25:47 AM »
I did have a dat file created in the users directory but running it as I put it in the crontab told me no dat file found. I rean with the argument added --makedat and it created another dat file in the /root dir. Is this where it should begiven how it is run from the crontab I created?

Can you give me an example crontab entry?

Jon Blakely

Re: How to run ipcheck as a cron job
« Reply #5 on: December 11, 2002, 04:58:31 AM »
Ok this is how I set mine up

I made a directory /opt/ipcheck.

In this directory is my

acctfile (which contains dyndns username, password and domain).
ipcheck.dat
ipcheck.py

In /etc/e-smith/templates-custom/etc/crontab

i created a file 90dyndns-update which contains

*/15 * * * * root python /opt/ipcheck/ipcheck.py -c -a $address -d /opt/ipcheck --acctfile /opt/ipcheck/acctfile

-c  custom dyndns zone. If you just have normal zone then you dont need it
-a $address is the address I get from the router via snmp. You will need to use
-r checkip.dyndns.org:8245
-d /opt/ipcheck  location of ipcheck.dat
--acctfile /opt/ipcheck/acctfile   location of account file

Jon