To get that, you can use the command
grep "reseller" /etc/trueuserowners | awk -F : {'print $1'} >> /root/accounts
Now, create a file called mig.sh and enter the below command,
Set the permission to 755
Now ,
for i in `cat /root/accounts`
do
/scripts/pkgacct --skiphomedir $i
scp /home/cpmove-$i.tar.gz root@<Dest IP>/home
ssh <Dest IP> -l root /scripts/restorepkg --force /home/cpmove-$i.tar.gz | tee /root/restore_log.txt
rm -vf /home/cpmove-$i.tar.gz
rsync -avz -e 'ssh -p 22' /home/$i root@<Dest IP>:/home/
done
To make this work, auto SSH need to be configured using the below command,
=-=-=-=-=-
Source Server :
ssh-keygen -t rsa
ssh b@B mkdir -p .ssh
cat .ssh/id_rsa.pub | ssh b@B 'cat >> .ssh/authorized_keys'
=-=-=-=-=-
Here,
b- Source server
B-Destinaton Server
=--==-=-=-
Done