This is a discussion on Shell code for Restoring cpmove accounts(bulk amount) within the Shell scripting forums, part of the Development/Scripting category; Hello My server's hard disk is going to replace tomorrow. I need this script very urgently. I have all account's ...
|
|||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
|||
|
Hello
My server's hard disk is going to replace tomorrow. I need this script very urgently. I have all account's backup as Code:
username.tar.gz I moved these files into another server using rsync and scp.. When I get the new hard disk with new OS installation, I need to restore these files very quickly. I know there is a function in whm for restoring files. but the total number of accounts are about 600+ So I can not do this way. I know that this way I can restore accounts using ssh Code:
/scripts/restorepkg username So, I need to get a code for collecting all the usernames from the file "username.tar.gz" and applying this function as a loop Urgently required. Please help me Thank you Vivek |
| Sponsored Links | ||
|
|
|
||||
|
You may need to run something as follows (assuing that you have resored /var/cpanel/user:
On main server (to backup) Code:
for i in $(ls /var/cpanel/users) do /scripts/pkgacct $i done Code:
for i in $(ls /var/cpanel/users) do /scripts/restorepkg $i done Code:
for f in *.tar.gz; do u=$(echo $f| cut -d'.' -f1); /scripts/restorepkg $u ; done
__________________
Rocky Jr. You may have my body & soul, but you will never touch my pride! If you have knowledge, let others light their candles at it. Certified to work on HP-UX / Sun Solaris / RedHat Last edited by rockdalinux; 12-03-2007 at 09:39 PM. |
|
|||
|
Code:
#!/bin/bash for f in *.tar.gz; do u=$(echo $f| cut -d'.' -f1); /scripts/restorepkg $u ; done Thank you very much Vivek Quote:
|
![]() |
| Bookmarks |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Adding Users in Bulk + Passwords and permissions | ricksd2sd | Shell scripting | 0 | 04-23-2008 12:20 PM |
| PHP code performance | zafar466 | Linux software | 1 | 04-22-2007 08:23 PM |
| Shell script or code for deleting a user | narasimha.reddygnv | Shell scripting | 5 | 03-19-2007 10:07 AM |
| OpenSolaris Code Released | monk | The Hangout | 1 | 06-21-2005 03:10 PM |
| SNMP error CODE | MRTG Mediocre | Linux software | 3 | 03-18-2005 01:05 PM |