You are not logged in.

#1 2005-05-05 00:41:36

ruwach
Member
Registered: 2004-06-14
Posts: 143

Need help with a cron job

i have a python script that updates my ip address with zoneedit.
i would like to run it every hour from cron or something similar.
i thought i set it up right in webmin, but it doesnt work.
so.... any suggestions?

Offline

#2 2005-05-05 00:46:58

viniosity
Member
From: Washington, DC
Registered: 2005-01-22
Posts: 377
Website

Re: Need help with a cron job

I assume your python script runs correctly when you run it manually?  If so, post your cron entry so we can take a look.

Offline

#3 2005-05-05 00:50:54

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,615
Website

Re: Need help with a cron job

why use a python script? Just use wget...
http://wiki2.archlinux.org/index.php/Zo … namic%20IP

my cron example is at the bottom.


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#4 2005-05-05 00:53:49

Stinky
Member
From: The Colony, TX
Registered: 2004-05-28
Posts: 187

Re: Need help with a cron job

as root do

crontab -e

then make an entry like this...

01 * * * * /where/your/script/lives/script.py

This will run the script the first minute of every hour.
EDIT
LOL.  while I was typing this up, two people beat me to it.   lol

Offline

#5 2005-05-05 01:08:59

ruwach
Member
Registered: 2004-06-14
Posts: 143

Re: Need help with a cron job

Yep, when i run the script from a terminal , it works.
here is the entry
@hourly python /home/nephish/ipupdate.py

by the way, what editor is that when you use crontab -e? is that vim ? ick. any way to get it in gedit, or nano, or something?
thanks for all of the quick responses by the way !

Offline

#6 2005-05-05 01:11:20

ruwach
Member
Registered: 2004-06-14
Posts: 143

Re: Need help with a cron job

i like the wget thing from the wiki, but i am hosting 4 zones now that are just one line in the python script. i want to learn some python anyway because i heard that it is easier than perl.
thanks again.

Offline

#7 2005-05-05 01:13:09

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,615
Website

Re: Need help with a cron job

export EDITOR=/bin/nano
crontab -e

might work...or whatever the path is..


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#8 2005-05-05 01:14:32

Stinky
Member
From: The Colony, TX
Registered: 2004-05-28
Posts: 187

Re: Need help with a cron job

Yep.  crontab -e opens it in vi.  I dunno how to get it to open in nano or something else.  I don't think you can but....not sure.  never tried.

vi is your friend!   tongue

Offline

#9 2005-05-05 03:18:05

ruwach
Member
Registered: 2004-06-14
Posts: 143

Re: Need help with a cron job

oh, wait.
got it guys,
thanks

Offline

Board footer

Powered by FluxBB