Restoring file ownerships in Plesk httpdocs directories

To restore proper ownerships to everything within Plesk's httpdocs directories (assuming the httpdocs directory itself has the correct ownership)

#!/bin/bash
for i in `ls /home/httpd/vhosts/ |grep "\."`
do
chown -R `ls -l /home/httpd/vhosts/$i|grep httpdocs|awk {'print $3'}`:psacln /home/httpd/vhosts/$i/httpdocs/*
done

Submitted by jkelly on Fri, 2006-10-27 03:49. categories [ | ] login or register to post comments