Results 1 to 6 of 6

Thread: Need help with a cron job for a .sh file

  1. #1
    Join Date
    Jan 2012
    Posts
    1

    Default Need help with a cron job for a .sh file

    I am trying to set up a cron job to run a .sh file (let's call it test.sh for our purposes here)

    When I am in a shell command window, if I run: sh test.sh
    my file works great and does exactly what I want it to do.

    However, I can not figure out to get the cron job to work correctly.

    I thought it would be: /usr/bin/sh ~/test.sh
    but that didn't work.

    I also tried: /usr/bin/sh test.sh
    and: sh ~/test.sh
    and: sh test.sh

    and a whole bunch of other things but I can't get it to work.

    I had another file that I tested on a cron job and it worked fine like this: /usr/bin/wget http://www.mydomain.com/anothertest.php, so I can make a cron job work.

    Anyways, if someone can help me know what to type into the command line to make my .sh file work I would appreciate it.

    Thanks.

  2. #2
    Join Date
    Feb 2006
    Posts
    626

    Default

    I use something like ...

    sh /home/SITENAME/LOCATION/test.sh

    But that's been running for years and I think the new stuff should use /home1/ instead of /home/


    Hope that helps

  3. #3
    Join Date
    Sep 2006
    Location
    The Wasatch Front
    Posts
    172

    Default

    We create soft links in /home so that scripts and the like don't break in the event that your account is moved to a different partition. Using file paths with /home should actually be more flexible than using direct physical paths.

  4. #4
    Join Date
    Feb 2012
    Posts
    6

    Default Need help with a cron job for a sh file

    Hay, I need some help with this code I changed it but it dont work correctly . This script dont replace 1 Torge -> to 2 Torge it logs my name again and there is still the 1 .. maybe someone can help me ?

    Code:
    PHP Code:

  5. #5
    Join Date
    Apr 2008
    Location
    Morgan Hill, CA
    Posts
    873

    Default

    Quote Originally Posted by AnnaS1980 View Post
    Hay, I need some help with this code I changed it but it dont work correctly . This script dont replace 1 Torge -> to 2 Torge it logs my name again and there is still the 1 .. maybe someone can help me ?
    Your question doesn't appear to relate to the thread topic. You're more likely to get help by starting a new thread with a title that describes your problem.

    Also, please be more specific in describing the problem:

    1. I have no idea what replacing '1 Torge' to '2 Torge' means.

    2. It appears that you didn't post your script code to the message.

  6. #6
    Join Date
    Feb 2012
    Posts
    6

    Default Need help with a cron job for a sh file

    Thanks I was just pasting in the code from the site. I have tried renumbering like you said but it didnt work. It was probably with the anchor, I think I forgot that part. Will try again tomorrow. Thanks again for the help.

Posting Permissions

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