2

My shell script runs from the command line, but fails in cronjob.

/bin/sh: asper.sh: Permission denied

-rw-r--r-- asper.sh

I guess the permission should look like '-rwxr-xr--'

How can I change the permission to be like that?

2
  • chmod +x asper.sh. Also, this is not really a Stack Overflow question. Maybe superuser? Server fault?
    – asveikau
    May 12, 2011 at 4:27
  • chmod +x asper.sh will result in -rwxr-xr-x which will also work, but is not the permission setting asked for in the question.
    – Trott
    May 12, 2011 at 4:30

2 Answers 2

2

If you want permissions to look like -rwxr-xr--:

chmod 754 asper.sh
0

If you just want to add the execute bit, it's as easy as:

chmod +x asper.sh

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.