View Single Post
Old 21st December 2010, 19:44
Croydon Croydon is offline
ISPConfig Developer
Join Date: Jul 2007
Location: Koblenz, Germany
Posts: 932
Thanks: 16
Thanked 264 Times in 208 Posts

I had some thoughts about how I could change all the ownerships of the files in the mail user directory with one single command.

So here comes the command - use it at your own risk.
I don't think that it harms anything - but who knows

find /var/www/ -user root -wholename "*/user/w*" -exec sh -c "(dirname {} | sed -r \"s/.*\/user\/(([^_]+)_[^\/]+)(\/.*)?/chown -v \1:\2 /\" ; echo {}) | xargs echo | xargs -0 sh -c "  \;
Reply With Quote