scj.sh

Post Reply
Ricky B
Posts: 78
Joined: Sat Nov 24, 2012 12:39 am

scj.sh

Post 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!
admin
Site Admin
Posts: 38004
Joined: Wed Sep 10, 2008 11:43 am

Re: scj.sh

Post by admin »

i have put it in the root of my account
May be it should be

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

?
Don't forget to run script update
Ricky B
Posts: 78
Joined: Sat Nov 24, 2012 12:39 am

Re: scj.sh

Post 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
Ricky B
Posts: 78
Joined: Sat Nov 24, 2012 12:39 am

Re: scj.sh

Post 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.
admin
Site Admin
Posts: 38004
Joined: Wed Sep 10, 2008 11:43 am

Re: scj.sh

Post by admin »

Yep, pretty common problem with windows-unix systems
Don't forget to run script update
Post Reply