how to /scripts/pkgacct with multiple accounts.

mohit

Well-Known Member
Jul 12, 2005
553
0
166
Sticky On Internet
hi,
any one with a script to backup 10 or 20 or more accounts using /scripts/pkgacct username in ssh,
Iam 700 accounts manually, and its taking ages for me to package each account then copy to another server and so on.

copy account from another server options seems broken even when both server are running same version.

Code:
Warning: file location not sent.. guessing.. this may not work ....
Using the single archive method (/home/cpmove-hidden.tar.gz)!
Transfer ErrorThe remote server didn't report a correct md5sum of the archive. Please ensure you selected the correct type of remote server.
see ya.
mohit
 

Spiral

BANNED
Jun 24, 2005
2,018
8
193
You would just need a simple loop script for that to read in the list
of users on the server and run /scripts/pkgacct against each username

Code:
#!/bin/bash
IFS="$"

cd /var/cpanel/users

find .  -type 'f' | while read CPUSER; do
  echo "Now processing ${CPUSER} ..."
  /scripts/pkgacct ${CPUSER}
done
All the backups would end up under /home as cpmove files and
you could just use FTP to transfer them to any server
 

mohit

Well-Known Member
Jul 12, 2005
553
0
166
Sticky On Internet
hi,
thanks for the excellent script, but i want to specify the usernames manually, may be 10-15 at a time only.

can you help me .

thanks for sparing your time.

see ya,
mohit
 

Spiral

BANNED
Jun 24, 2005
2,018
8
193
Just a slight variation in that case ...

Create a file named "backup.txt" with the usernames of the accounts
that you want to backup (one username per line):

Code:
#!/bin/bash
IFS="$"

cat ./backup.txt | while read CPUSER; do
  echo "Now processing ${CPUSER} ..."
  /scripts/pkgacct ${CPUSER}
done