Update Plesk package using command line, for already created domains.

echo “SELECT d.name FROM domains d , Limits L JOIN Limits L2 ON L2.id=L.id WHERE d.limits_id=L.id AND L.value=4194304000 AND L2.limit_name=’disk_space’ AND L2.value=52428800″| mysql -Ns -uadmin -p`cat /etc/psa/.psa.shadow` -Dpsa | while read domname ;

do

/usr/local/psa/bin/domain_pref –update $domname -disk_space 100M -max_traffic 8000M;

/usr/local/psa/bin/domain –update $domname -hard_quota 100M;

done

Using the above command/script we can update the package 50M/4GB bandwidth to 100MB/8GB

In the MySQL query you need to give the vale of 50M as bytes ie 50*1024*1024 and bandowth as 4000*1024*1024.

Advertisements
1 comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: