Koozali.org: home of the SME Server

Legacy Forums => General Discussion (Legacy) => Topic started by: keaaa on September 26, 2003, 10:59:25 PM

Title: Run command every X minutes
Post by: keaaa on September 26, 2003, 10:59:25 PM
Yeah...

I know this must be a pretty simple thing to do, but I'm a beginner to linux.

How do I run a command automatically every ~5 or 10 minutes? I just need to run this line:

lynx -source -auth=username:password 'http://dynamic.zoneedit.com/auth/dynamic.html?host=www.mydomain.com'

(I think) every couple minutes to make sure my IP is up to date.

Please run step thru step, remember I'm a beginner, I can mess things up really easily. :(

Thanks!!

keaaa
Title: Re: Run command every X minutes
Post by: Dan Brown on September 26, 2003, 11:08:57 PM
Are you sure that's the best way to do it?  Some dynamic DNS providers, like dyndns.org, will suspend your account if you're frequently "updating" without a changed IP address.  To do that, though, you'd do something like this at the command prompt:

# pico /etc/cron.d/zoneedit

*/10 * * * * root /usr/bin/lynx  -source -auth=username:password 'http://dynamic.zoneedit.com/auth/dynamic.html?host=www.mydomain.com'

(all on one line), then save that file.

# /etc/rc.d/init.d/crond restart

This will run it every 10 minutes.  If you want to do it every 5, use */5 in the first field instead of */10.
Title: Re: Run command every X minutes
Post by: Nathan Fowler on September 27, 2003, 12:45:01 AM
Could you perhaps append it to the end of the ip-change event?

Dan, you could probably provide more information since I'm not up to speed on the version information, but if signal-even ip-change still exists, perhaps it can be appended there.
Title: Re: Run command every X minutes
Post by: keaaa on September 27, 2003, 12:48:05 AM
Thanks guys. If I could do it upon IP-change, that would be even better!
Title: Re: Run command every X minutes
Post by: Dan Brown on September 27, 2003, 01:12:32 AM
Actually, the "right" way to do it would probably be to just change the custom dyndns script to do what the user wants, and configure the server to work with that.  I'm pretty fuzzy on the details (it's been a while since I did anything with dynamic dns), but I'm pretty sure that a search here on custom dynamic dns (using all dates) would locate some more specific information.

But yes, the ip-change event still exists.
Title: Re: Run command every X minutes
Post by: Doug M. on September 27, 2003, 03:37:18 AM
Check out ddclient

http://freshmeat.net/projects/ddclient/?topic_id=149%2C150%2C152%2C253

http://members.rogers.com/ddclient/pub/ddclient.tar.gz

ZoneEdit is one of it's supported systems.
Title: Re: Run command every X minutes
Post by: TrevorB on September 27, 2003, 03:41:26 AM
A search for zonedit (all dates) will retrieve pages of discussion.

This particular thread has a printed script
http://forums.contribs.org/index.php?topic=14590.msg55751#msg55751

Trevor B
Title: Re: Run command every X minutes
Post by: keaaa on September 28, 2003, 04:29:23 PM
Thanks! I think Trevor's is the one I will use.

Thanks again.

keaaa