View Single Post
  #10  
Old 21st December 2010, 18:44
Croydon Croydon is offline
ISPConfig Developer
 
Join Date: Jul 2007
Location: Koblenz, Germany
Posts: 756
Thanks: 15
Thanked 215 Times in 166 Posts
Default

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

Code:
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