Crontab frustration running .pl

Joined
Feb 27, 2004
Messages
11
Reaction score
0
Points
1
Location
Chester, Cheshire, UK
Your Mac's Specs
MacPro with 30" ACD, 3GB RAM, 250GB HDD (more to come), Airport and Btooth EDR
[Originally posted on cubeowners forum but no help from there so apologies to anyone who may have read this on another site]
My ISP keeps changing IP address every few days even though they say it should remain steady for a few months at least. I have a DNS2GO account from back inthe day when i used a PC running windows. That had a simple tray prog that sat sending heartbeats to DNS2Go's system and everytime an IP change happened my domain http://scoopz.d2g.com would be updated to point to my new IP.
I've been trying to get DNS2Go to work for ages on my Mac (OS X 10.3) and finally found out they have a perl version available. I downloaded this, set up the files but it failed to run, so i updated to perl 5.8.5 and joy, I can now manually start the script in terminal:
Code:
G4Cube:/Library/Dns2go scoopz$ perl online.pl
Success
and this will update my IP with DNS2Go's system.
Right all i want to do now is set this to run every 5 minutes. Some investigation and I figure out that i need to add an entry to the crontab to execute this. I used pico to edit the main system crontab:
Code:
G4Cube:/Library/Dns2go scoopz$ sudo pico /private/etc/crontab
which looks like this:
Code:
# /etc/crontab
SHELL=/bin/sh
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
HOME=/var/log
#
#minute hour * *mday * *month * wday * *who * * command
#
#*/5 * ** * * * * * * * * * * * * * * * root * */usr/libexec/atrun
#
# Run daily/weekly/monthly jobs.
15 * * *3 * * * * * * * * * * * * * * * root * *periodic daily
30 * * *4 * * * * * * * * * * * 6 * * * root * *periodic weekly
30 * * *5 * * * 1 * * * * * * * * * * * root * *periodic monthly
and then i added the following line to the bottom:
Code:
*/5 * ** * * * * * * * * * * * * * * * root * */Library/dns2goperl/online.pl
But it doesn't work.
Any ideas guys & girls?
Whilst running:
Code:
G4Cube:/Library/Dns2go scoopz$ perl online.pl
Success
in that directory it all works fine, but if i go to another directory and run (what i thought would be exactly the same as running the above):
Code:
G4Cube:/ scoopz$ perl /Library/Dns2go/online.pl 
Undefined subroutine &main::DNS2GoUpdate called at /Library/Dns2go/online.pl line 10.
it now returns the same error i was getting before i updated to perl 5.8.5
 
F

flonejek

Guest
just replace the command with:

cd /Library/dns2goperl/ && perl online.pl

the "&&" means "run after previous command completes"
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top