View Single Post
  #6  
Old 25th October 2011, 11:28
ircf ircf is offline
Junior Member
 
Join Date: Feb 2011
Posts: 28
Thanks: 5
Thanked 7 Times in 4 Posts
Default Integrate pure-quotackeck in ISPConfig ?

Hello again,

I couldn't find a solution to automate pure-quotacheck on each user dir so I added this script to my ISP Config cron_daily.php (right before the die("finished"); line) :

Code:
#######################################################################################################
// Check quotas for Pure FTP
#######################################################################################################

$sql = "SELECT document_root, system_user FROM web_domain WHERE server_id = ".$conf['server_id'];
$records = $app->db->queryAllRecords($sql);
$app->uses('system');
if(is_array($records)) {
        foreach($records as $rec){
                $web_path = realpath(escapeshellcmd($rec['document_root']));
                $web_user = $rec['system_user'];
                if($web_path != '' && strlen($web_path) > 10 && is_dir($web_path) && $app->system->is_user($web_user)){
                        //echo "/usr/sbin/pure-quotacheck -u $web_user -d $web_path\n";
                        exec("/usr/sbin/pure-quotacheck -u $web_user -d $web_path");
                }
        }
}
I just copied/pasted the "clear tmp dir" section and replaced some code.

That could be a good thing to add a test to ensure system uses pure-ftp and maybe add this script to the official cron_daily.php ?

Because without this, FTP quotas with pure-ftp just won't be updated (and won't work), or maybe there is another way to handle FTP quotas with pure FTP in ISP Config ?

Thank you.
Reply With Quote