[BlueOnyx:01466] Re: Automatically create users from a file

Ken Marcus - Precision Web Hosting, Inc. kenmarcus at precisionweb.net
Mon Jun 22 11:51:02 PET 2009

----- Original Message ----- 
From: "Manuel Bona" <mbona at svalero.es>
To: "BlueOnyx General Mailing List" <blueonyx at blueonyx.it>
Sent: Sunday, June 21, 2009 10:02 PM
Subject: [BlueOnyx:01465] Re: Automatically create users from a file

> Some examples of these scripts?
> I lost something and no where to start
> thanks
> Manuel Bona
> mbona at vmgrupo.es
> Michael Stauber escribió:
>> Hi Manuel,
>>> I need to create users automatically every hour from a file, as is done
>>> from the control panel BlueOnyx in: *Site Management > User Management >
>>> Import > Url*
>> That is a bit unusual.
>> You could write a script that parses your textfile and then uses the
>> "/usr/sbin/cadduser" command to create the desired user(s).
>> Here are the commands that the 5100R-shell-tools provide:
>> /usr/sbin/cadduser
>> /usr/sbin/caddvsite
>> /usr/sbin/cdeluser
>> /usr/sbin/cdelvsite
>> /usr/sbin/clistuser
>> /usr/sbin/clistvsite
>> /usr/sbin/cmoduser
>> /usr/sbin/cmodvsite
>> They allow you to add / modify / delete sites and users from the command 
>> line.
>>> You also need to remove users who have more than 6 months without access
>>> to e-mail account.
>> User logins to POP3, IMAP and SMTP is of course logged in 
>> /var/log/maillog and
>> /var/log/secure. But as those logs are rotated and packed frequently.
>> So you'd have to set up a script that builds a list of users, parses the 
>> logs
>> at least once a day and builds a small database that keeps track of who 
>> logged
>> in when for the last time. Based on that you could then use 
>> /usr/sbin/cdeluser
>> to delete users that haven't logged in to email in the last six months.

>From a perl script it would be something like

system("/usr/sbin/cadduser --name=$adminuser --password='$password' --fullname='adminuser 
controls FTP and siteadmin 
access' --fqdn=$hostname.$domainname --admin --adminPassword='$serveradminpassword' 
  --quota=$sitequota ");

Ken Marcus
Ecommerce Web Hosting by
Precision Web Hosting, Inc.

More information about the Blueonyx mailing list