Results 1 to 2 of 2
  1. #1
    Crontab frustration running .pl
    scoopz's Avatar
    Member Since
    Feb 27, 2004
    Location
    Chester, Cheshire, UK
    Posts
    11
    Specs:
    MacPro with 30" ACD, 3GB RAM, 250GB HDD (more to come), Airport and Btooth EDR
    Crontab frustration running .pl
    [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
    Regards
    Scoopz
    Scoopz Homepage

  2. #2
    flonejek
    Guest
    just replace the command with:

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

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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Auto Type password for sudo command from crontab
    By aceofsplades in forum OS X - Operating System
    Replies: 1
    Last Post: 09-19-2014, 10:59 PM
  2. HELP!crontab script displays output differently than command line
    By spankincubus in forum OS X - Apps and Games
    Replies: 3
    Last Post: 02-04-2012, 02:08 PM
  3. Crontab
    By brianbond in forum OS X - Operating System
    Replies: 6
    Last Post: 10-20-2007, 08:42 PM
  4. Remove line from /etc/crontab
    By dstrebel in forum OS X - Operating System
    Replies: 2
    Last Post: 02-21-2006, 12:25 AM
  5. crontab for osx
    By estrellas in forum OS X - Operating System
    Replies: 5
    Last Post: 07-27-2004, 12:37 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •