Starting shell script?

WDMyCloud:/usr/local/sbin# deletejpg.sh
-bash: /usr/local/bin/deletejpg.sh: /usr/local/bin: bad interpreter: Text file busy
WDMyCloud:/usr/local/sbin#

What is the problem?

This is the contents of deletejpg.sh:

#!/bin/sh
find /shares/ftp -type f -mtime +20 -exec rm {} ;

go to the directory with the deletejpg.sh

and type 

chmod 777 deletejpg.sh

or just type the whole path

chmod 777 /usr/local/bin/deletejpg.sh

With linux you have to change the permissions to execute and to make it easy the three 7’s means everyone can read,write and execute the file. No I’m not going to help you limit it down to only one person can execute the file. But since you are the only one with the password to root through SSH, you will be the only one that knows that the program is there.

careful with your rm there as you could inadvertantly erase everything from your root :stuck_out_tongue: and you will have to follow another post on restoring your Cloud…

if “chmod 777 deletejpg.sh” does the same thing as:

chmod +x /usr/local/sbin/deletejpg.sh

…then there is another reason…

My guess is that the Interpreter cannot be found?

go4java wrote:

if “chmod 777 deletejpg.sh” does the same thing as:

 

chmod +x /usr/local/sbin/deletejpg.sh

 

…then there is another reason…

 

My guess is that the Interpreter cannot be found?

True and true…

try deleting the line. I have scripts that don’t have that line and I don’t know what it defaults to…

My other scripts has this in it

#!/bin/bash

none has #!/bin/sh

Thanks!

Both, #!/bin/bash and without this line seem to work. Now have to find out how to email the result… BR