Page 1 of 1

scj.sh

Posted: Mon Jun 10, 2013 2:41 am
by Ricky B
I have 16 domain on my server and i need to fix the cron job sequence, my cpu load too high when cron job are set to 1 minute.

I have done a scj.sh and i have put it in the root of my account but the cron job don't start

my scj.sh look like that

Code: Select all

cd /home/account/public_html/domain1.com/scj/bin; env HTTP_HOST=domain1.com /usr/bin/php -q cron.php &
sleep 3
cd /home/account/public_html/domain1.com/scj/bin; env HTTP_HOST=domain1.com /usr/bin/php -q rot.php &
sleep 3
cd /home/account/public_html/domain2.com/scj/bin; env HTTP_HOST=domain2.com /usr/bin/php -q cron.php &
sleep 3
cd /home/account/public_html/domain2.com/scj/bin; env HTTP_HOST=domain2.com /usr/bin/php -q rot.php &
sleep 3
and i have put the cron job setting like that

Code: Select all

*/1 * * * * cd /home/account/public_html/ ; sh scj.sh
i have put chmod 755 on the scj.sh file

someone can help me to fix it thank you!

Re: scj.sh

Posted: Mon Jun 10, 2013 6:16 am
by admin
i have put it in the root of my account
May be it should be

*/1 * * * * cd /home/account/ ; sh scj.sh

?

Re: scj.sh

Posted: Mon Jun 10, 2013 6:51 pm
by Ricky B
the file is in the public_html
i have start the file by ssh cli ./scj.sh and i receive

Code: Select all

Try `sleep --help' for more information.
: command not found
sleep: invalid time interval `3\r'
Try `sleep --help' for more information.
./scj.sh: fork: retry: Resource temporarily unavailable
./scj.sh: fork: retry: Resource temporarily unavailable
./scj.sh: fork: retry: Resource temporarily unavailable
: command not found
sleep: invalid time interval `3\r'
Try `sleep --help' for more information.
./scj.sh: fork: retry: Resource temporarily unavailable
: command not found
sleep: invalid time interval `3\r'
Try `sleep --help' for more information.
: command not found

Re: scj.sh

Posted: Mon Jun 10, 2013 11:18 pm
by Ricky B
Ok i have find the solution its now possible to start the script by sh command, it was because the file was uploaded in binary mode and the space character are badly take. I have reupload in ASCII mode and its working.

Re: scj.sh

Posted: Tue Jun 11, 2013 6:04 am
by admin
Yep, pretty common problem with windows-unix systems