PDA

View Full Version : Need help with a cron job for a .sh file



JGuiher
01-22-2012, 06:41 PM
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.

siguie
01-27-2012, 03:39 AM
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 :)

cade
01-28-2012, 01:19 PM
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.

AnnaS1980
02-25-2012, 07:17 AM
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:

Bob Barr
02-25-2012, 12:06 PM
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.

AnnaS1980
03-03-2012, 07:03 AM
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.