0

I had a software developed. And now my developer is no longer working with me. I have about 40 users on this, and it seems this thing is ran manually. Yet it was working for the users when they used their copy of it. Im so lost. Any help much appreciated.

His instructions say this:

script_run_scrapers.sh: bash script for run the ranks scrapers (googlerank, googlevideorank and youtuberank) via wget

sample for run 300 scrapers

./script_run_scrapers.sh 300 10

This is the code in the script:

max=$1
maxy=$2
while [ 1 ] ; do
    x=`ps -Af | grep wget | grep -c "path_to_web"`;
    echo $x;
    if [ $x -lt $max ] ; then
        r=$RANDOM;
        #echo $r;
        i=1;
        y=$(( $max - $x ));
        while [ $i -le $y ] ; do
            wget -O /dev/null -o /dev/null "http://127.0.0.1/path_to_web/googlescraper.php?max=$maxy"  2>&1 &
            i=$(( $i + 1 ));
        done;
    fi;
    sleep 5s;
done;

enter image description here

muru
  • 207,228

1 Answers1

1

In order to make your script executable, you need to use chmod +x and specify the file you are modifying.

So

chmod +x script_run_scrapers.sh

As it stands you have just run

chmod +x

but not specified the file that is to be made executable.

You have also typed cd to change directory, but have not specified where you want to change directory to. For example :

cd /home/victor

will change directory to /home/victor/

I think what you are wanting to do is change into the directory that holds your script, then modify the permissions of your script so that is is executable, then execute it ?

Lets assume your script is in the directory /home/victor/

cd /home/victor/

chmod +x script_run_scrapers.sh

That only has to be done once, then all you have to do is execute it

./script_run_scrapers.sh 300 10

To check the current permission of the file, use ls -la

ls -la script_run_scrapers.sh
hatterman
  • 2,330