Koozali.org: home of the SME Server

Run command every X minutes

keaaa

Run command every X minutes
« 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

Dan Brown

Re: Run command every X minutes
« Reply #1 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.

Nathan Fowler

Re: Run command every X minutes
« Reply #2 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.

keaaa

Re: Run command every X minutes
« Reply #3 on: September 27, 2003, 12:48:05 AM »
Thanks guys. If I could do it upon IP-change, that would be even better!

Dan Brown

Re: Run command every X minutes
« Reply #4 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.

Doug M.

Re: Run command every X minutes
« Reply #5 on: September 27, 2003, 03:37:18 AM »

TrevorB

Re: Run command every X minutes
« Reply #6 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

keaaa

Re: Run command every X minutes
« Reply #7 on: September 28, 2003, 04:29:23 PM »
Thanks! I think Trevor's is the one I will use.

Thanks again.

keaaa