Anyone know cron?

Discussion in 'Customization & add-ons' started by Big Kahuna, Oct 23, 2004.

  1. Big Kahuna

    Big Kahuna Guest

    This isn't directly connected to aMember, so I appologize for bringing it up, but nobody seems to be able to help me. I'm installing a script that I hope will be integrated with aMember soon. The people that sold me the script, now that they have my money, do not reply to my emails (not everybody's as honest as Alex, I guess...). So I'm forced to look for help else where... I tried my hosting service (Lunar Pages), but they just emailed me and said they couldn't help (?).

    Here's what I'm trying to do:

    I'm trying to set up a CRON job to run a .PHP file on my website.

    The CRON command in the install docs was:

    0 * * * * root /usr/bin/lynx -auth=username: password -dump /home/mysite/public_html/myprogram/admin/myscript.php > text.txt

    This doesn't work. It's supposed to pass the username: password, dump the results to a dummy file (text.txt) and run every hour.

    Basically I need to pass the .PHP file the username and password in order for it to run. I've searched everywhere for information on how to do this, but haven't found anything.

    Can anyone help?

    Thanks,

    Paul
  2. alex

    alex Administrator Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,020
    Just SSH to your server, and run from command line:

    /usr/bin/lynx -auth=username: password -dump /home/mysite/public_html/myprogram/admin/myscript.php

    what do you see?
  3. Big Kahuna

    Big Kahuna Guest

    Ok, at the risk of sounding like a complete idiot, what's SSH?

    I'll email you the details...

    Paul
  4. Big Kahuna

    Big Kahuna Guest

    My site is hosted by Lunar Planet, and they don't support SSH or Telnet.

    Still haven't gotten the site to work, but I'm still working on it...

    Paul
  5. netserv3

    netserv3 Guest

    You can use virtual telnet or phpshell scripts. Phpshell is a free script that can be used to run cron jobjs, debug perl scripts and many other shell functions in a hosting environment where shell access is not available.

    http://www.gimpster.com/wiki/PhpShell

    PS: You should make sure to protect your server folder containing phpshell with a password, so that no one else can execute it.

    On some servers the "lynx" is not located in /usr/bin/lynx. Install the phpshell, execute it and issue the command "whereis lynx" without quotes. This will provide you correct path to lynx. For example:

    lynx: /usr/bin/lynx /etc/lynx.cfg /usr/share/man/man1/lynx.1.gz

    Ok, the path to lynx is correct, now check the destination folder for the dump file if it has proper permissions? Try to change it to 777 with your ftp client software and rerun the command:

    usr/bin/lynx -auth=username: password - dump /home/mysite/public_html/myprogram/admin/myscript.php
  6. Big Kahuna

    Big Kahuna Guest

    Yup, that was the problem. The path to Lynx was wrong. Works now, thanks!!

    Paul

Share This Page