Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Aug 2006
    Posts
    4

    Default Need Help with my Cron Job Script [moved]

    Hello All:
    Over the past 3 days I have tried every cron job imagineable to get my backup script to run.

    Let me start at the begining, I have a backup script in php that will backup all my reseller accounts on my shared hosting. The problem is, I want to make a cron job so I do not have to run it every week.

    I set up in the cpanel to run http://www.gzws.com/backup.php in standard mode but that did not work.

    then, I set up php http://www.gzws.com/backup.php which returned it could not find the file backup.php but it was on my public server.

    I tried the example GET: that cpanel offers however I get an error saying that GET is not a valid command.

    Can someone tell me if I put this file in WWW or Public_html folder how do I make a cron job for it in standard mode.

    I got the selecting the time thing down, I just need to know what to do in that command line input box.

    whew...

    thanks for any advice or help,

    Paul

  2. #2
    Member
    Join Date
    Jan 2005
    Location
    /dev/null
    Posts
    770

    Default

    if you are running a php script from a cron job you will need to call the script by its unix path rather than the url itself

    e.g. php /home/username/public_html/backup.php

  3. #3
    Registered User
    Join Date
    Aug 2006
    Posts
    4

    Default

    Thanks Nick,
    I will try that and let you know what happens.

    Paul

  4. #4
    Registered User
    Join Date
    Aug 2006
    Posts
    4

    Default Got a weird message

    I don't know what this means but I got this from Cron Just now off my cpanel when I ran the script:

    ar: Removing leading `/' from member names
    tar: /home/gzws/public_html/media/silverion/SangKuriaNgs.usr: Cannot open: Permission denied
    tar: /home/gzws/public_html/media/silverion/si-kancil.chn: Cannot open: Permission denied
    tar: /home/gzws/public_html/media/silverion/Kalor-Ijau.chn: Cannot open: Permission denied
    tar: /home/gzws/public_html/media/silverion/SangKuriaNgs.chn: Cannot open: Permission denied
    tar: /home/gzws/public_html/media/silverion/si-kancil.usr: Cannot open: Permission denied
    tar: /home/gzws/public_html/media/silverion/Kalor-Ijau.usr: Cannot open: Permission denied
    tar: Error exit delayed from previous errors
    X-Powered-By: PHP/4.4.3
    Content-type: text/html

    - - End Script Here - -

    If you want to exclude a directory, add the --exclude parm to the tar command as shown in the example below (which will exlcude the public_html/audio directory):
    system("tar --create --preserve --gzip --file=".$target." --exclude ~/public_html/audio ~/public_html ~/mail",$result);


    I am assuming this is cause of the script I hav and not the cron job I just set up.

    thanks for any advice again.

    Paul

  5. #5
    Member
    Join Date
    Jan 2005
    Location
    /dev/null
    Posts
    770

    Default

    indeed it is, the script doesnt have permission over the files its trying to tar

  6. #6
    Registered User
    Join Date
    Aug 2006
    Posts
    4

    Default

    Great,

    thanks again Nick for all your help.

Similar Threads & Tags
Similar threads

  1. cron job, help [moved]
    By tabuladze in forum New User Questions
    Replies: 4
    Last Post: 06-15-2006, 08:03 PM
  2. Problems php file - cron job [moved]
    By bogdanovici666 in forum New User Questions
    Replies: 2
    Last Post: 05-19-2006, 09:37 AM
  3. Possible to move files with cron job? [moved]
    By Phree in forum New User Questions
    Replies: 4
    Last Post: 02-22-2006, 09:05 AM
  4. Daily Cron job [moved]
    By Justin182004 in forum Data Protection
    Replies: 1
    Last Post: 09-24-2005, 05:14 PM
  5. Cron job help? [moved]
    By Katrina M. in forum New User Questions
    Replies: 2
    Last Post: 09-09-2005, 07:30 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube