R-Ts NetWorks

Server the Best

Script for restoring multiple accounts from backup


The following script can be used to restore multiple accounts from the backups.

It is assumed that all the backup files are already present in the /home directory in the tar.gz format.

#!/bin/bash

#######################
for i in `ls | grep tar.gz | cut -d- -f2 | cut -d. -f1`
do
echo “Restoring $i….”
/scripts/restorepkg $i
echo “$i restored”
echo “====================”
done
echo “Restoration completed”
#######################

Advertisements

October 13, 2012 - Posted by | Linux

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: