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.

Help with cron jobs

Discussion in 'General Discussion' started by systemtek, Jul 21, 2006.

  1. systemtek

    systemtek Member

    Joined:
    Jul 21, 2006
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Staffordshire, England
    Hi All

    I have written a script to use with the cron to backup mysql databases.

    Problem is when the script runs i get a e-mail to say it cant find the location of what i am trying to run, i have checked with my web provider and the path is :

    /home/USERNAME/

    so in the command i am doing

    bash /home/USERNAME/public_html/backup.sh

    The backup.sh is in the public_html dir.

    But it wont find it when that is that path, what am i doing wrong ? missing the obvious i guess but what ?

    Thanks
     
  2. elleryjh

    elleryjh Well-Known Member

    Joined:
    Apr 12, 2003
    Messages:
    479
    Likes Received:
    0
    Trophy Points:
    16
    Looks ok. What's the exact error you get?

    Edit: It might not know where bash is. Put the full path to bash in the cron, or just put #!/path/to/bash at the top of the script, chmod u+x it, and execute it directly.
     
    #2 elleryjh, Jul 21, 2006
    Last edited: Jul 21, 2006
  3. systemtek

    systemtek Member

    Joined:
    Jul 21, 2006
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Staffordshire, England
    The error in the e-mail is :

    /bin/sh: line 1: /home/USERNAME/public_html/backupsql.sh: No such file or directory

    Note : please ignore the fact that i called it backup.sh that was a typo in previous post, its backupsql.sh
     
    #3 systemtek, Jul 21, 2006
    Last edited: Jul 21, 2006
Loading...

Share This Page