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

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

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