M
M
Michael2018-10-03 17:31:17
linux
Michael, 2018-10-03 17:31:17

How to compose the correct chmod?

At the moment, when deploying magento 2 to jenkins, I use commands to change the rights to files taken from the office. the dock of magenta itself.

cd <your Magento install dir>
find var vendor pub/static pub/media app/etc -type f -exec chmod u+w {} \;
find var vendor pub/static pub/media app/etc -type d -exec chmod u+w {} \;
chmod u+x bin/magento

They work, but very slowly. I would like to use chmod directly instead of chmod+find. I hope to get an acceleration of at least a third.
How to make a chmod?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
vreitech, 2018-10-03
@fzfx

chmod does not handle wildcard substitutions on its own. you will either have to get a list of the necessary file names before this yourself with the same find (with the same performance, presumably), or use the bash syntax to specify a set of files, which, before executing the chmod commands, will split one command into several, searching itself (presumably with the same performance). something like:
however, bash will not do subdirectory lookups for you, be aware.
the only thing that can help you is the option -Rto recursively process directories and their contents.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question