list user

3 posts / 0 new
Last post
#1 Sun, 02/22/2015 - 07:11
ale.ab

list user

Hi,
i want to list each user in virtualmin for a script like this ( works on cpanel)

cd /var/cpanel/users

for i in *; do

rsync ...................

done

thank you

Mon, 02/23/2015 - 12:46
andreychek

Howdy,

Are you hoping to see a list of all Virtual Server owners?

To see all Virtual Server owners, you could use a command such as "virtualmin list-domains" to list all domains and admins in Virtualmin.

Then, to grab just the admins, which is the second column of that output, you can use "awk". And finally, since there could be duplicates in that output, the command "uniq" will remove all duplicates, so admins are only in there once.

The final command would look something like this:

virtualmin list-domains | awk '{print $2}' | uniq

Mon, 02/23/2015 - 14:07
ale.ab

thank you!

so, the script should to be

virtualmin list-domains | awk '{print $2}' | uniq

for i in *; do

rsync --recursive -avz /home/$i/ /backup/$i/

done

thank you

Topic locked