Current time: 12-23-2024, 11:52 PM Hello There, Guest! (LoginRegister)


Post Reply 
User limit & Quota
Author Message
cyber2 Offline
Newbie
*

Posts: 6
Joined: Jul 2009
Reputation: 0
Post: #5
RE: User limit & Quota
Do you made a hard quotas change?
if not - there is my dirty & simple script for set hard quotas

PHP Code:
#!/usr/bin/perl

#  Hard quota installer  for CentOs VPS v0.1                 
#  dirty & simple script created by 2lexx@mail.ru 02.08.2009 
#  to check quota  just type in console: repquota -a         


use DBI;

my $host "localhost";
my $port "3306";
my $user "root";
my $pass "PASSWORD_FOR_MYSQL_ROOT";
my $db "ispcp";


$dbh DBI->connect("DBI:mysql:$db:$host:$port",$user,$pass);
$sth $dbh->prepare("select domain_name,domain_uid,domain_disk_limit*1e3 from domain");
$sth->execute;

while (
$ref $sth->fetchrow_arrayref) {
`
/usr/sbin/setquota -u vu$$ref[1] 0 $$ref[2] 0 0 /`;
print 
"Hard quota for user vu$$ref[1],domain $$ref[0] is set to $$ref[2] 1k blocks\n";
}

$rc $sth->finish;
$rc $dbh->disconnect

I have been crontabbed it and it works ok Wink
Any suggesions?

Sorry my English is Bad, my native language is perl Wink
08-02-2009 07:53 PM
Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
User limit & Quota - tango - 02-25-2009, 06:59 AM
RE: User limit & Quota - RatS - 02-25-2009, 04:44 PM
RE: User limit & Quota - tango - 02-25-2009, 07:23 PM
RE: User limit & Quota - RatS - 02-25-2009, 09:53 PM
RE: User limit & Quota - cyber2 - 08-02-2009 07:53 PM
RE: User limit & Quota - MasterTH - 08-03-2009, 03:37 AM
RE: User limit & Quota - kilburn - 08-04-2009, 06:52 AM
RE: User limit & Quota - WuChEn - 11-25-2009, 06:05 AM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)