The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

adding php script to /scripts

Discussion in 'General Discussion' started by christi1, Jun 29, 2004.

  1. christi1

    christi1 Well-Known Member

    Joined:
    Oct 20, 2003
    Messages:
    65
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Texas, USA
    Is here a way to get a php script to run in /scripts so I can access it via WHM and/or so I can set it up as a cron? Cron would be preferable so it will just run every X hours and get it done without having to run it manually.

    OR... is it possible to add it to my own /home/user/ directory and chown root so it will have access to all things root?

    I've tried the 'shebang' line, tried renaming it *.cgi both in the /scripts directory and nothing.

    I've written a script to go into my mail que, compare the dates on each message to the current date and delete any message that is older than X number of hours.

    Even with my exim.conf set for 2 days, I am still getting loads of messages just hanging out and partying in que for well over a week.

    If you'd like a copy once we get it running, please let me know.

    Thanks in advance.
     
  2. kosmo

    kosmo Well-Known Member

    Joined:
    Aug 12, 2001
    Messages:
    403
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    All over Europe
    I guess it will run as root if you add it to your root cron. Just log in as root and enter:

    crontab -e

    This will start the editor for the root's own cron file.

    kosmo
     
  3. christi1

    christi1 Well-Known Member

    Joined:
    Oct 20, 2003
    Messages:
    65
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Texas, USA
    Yeh, I tried that too.

    Dropped it in /scripts and set it up as a cron and nothing. Renamed it as a *.cgi on a cron and still nothing.

    I've got it setup to send me an email even if it finds 'zero' messages that need to be removed, so make sure it's running properly.

    Gives me nothing at all.
     
Loading...

Share This Page