I am trying to integrate this shell command into a Capistrano 3 after deploy task:
find /var/www/mysite/somepath/ -type d -exec chmod 775 {} \;
However, I am failing at the proper Ruby syntax. I have tried most conceivable combinations between:
execute :find, "#{deploy_to}/somepath/ -type d -exec chmod 775 {} \;"
and
execute :find, "#{deploy_to}/somepath/", "-type d", "-exec", "chmod", "755", "{}", ";"
but invariably end up with the error: find: missing argument to -exec
Could anyone please help me with the proper way to separate the arguments of this command?
You are using wrong commands,
:findis for using ruby functions, but you want to usefindof linux utilities. Please try followingDon't forget in the last I have double slashes to terminate command. But there is more good way to do it using following commands
I was using it in my very old project like following
I think don't set permission of everything is really good idea, but when I did first time I was also getting confused so long time ago I have used following task which will go throughly and change all permission as you wanted
It has many things you remove and try what you want to do. Please note these are very old code, even I don't remember what are they doing, as I am not using capistrano any more to deploy but mostly dockers.