0

I have a shell script (build.sh) that ends by attempting to copy some files into a new directory. However it says:

mkdir: cannot create directory ‘/files/ondisk/shared//comp/auto/bleeding-1169-b28d31a’: Permission denied

when running the script.

The command is:

( umask 000; mkdir -p "${BASE}/${TARGET}" ) || exit -1
( umask 000; cp -r ${STORE} "${BASE}/${TARGET}" ) || exit -1

Does umask 000 not ensure that I am able to write to this location?

0

1 Answer 1

1

That double-slash in the pathname looks odd. Perhaps you have no permission to write the ${BASE}, which might be /files/ondisk/shared. The umask value is irrelevant, because it only affects the permissions of the directories and files which mkdir and cp create — not the permissions of the existing directory into which you are copying.

1
  • Thank you. I did indeed not have permission for all users in the folder in which I attempted to mkdir (in the script). I changed permissions for all users for that folder to rwx, and then it worked.
    – Nixxon
    Commented Apr 5, 2016 at 11:14

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.