A Shell Script to fix index injuction - restore from Cpanel backups
Hi guys ...
I want to share with you this nice script that I did with my best friend and I need a small help ...
if I have a list of users that I want to restore their index pages ? how my I integrate them ..
if [ $# -ne 1 ]
echo "Error in $0 - Invalid Argument Count"
echo "Syntax: $0 username"
sudo rm -f /home/$1/public_html/index.*
sudo rm -f /home2/$1/public_html/index.*
#as much homes you have
sudo tar -zxvf /backup/cpbackup/weekly//$1.tar.gz
sudo tar -xvvf /backup/cpbackup/weekly/$1/homedir.tar
sudo cp /backup/cpbackup/weekly/$1/public_html/index.* /home/$1/public_html/
sudo cp /backup/cpbackup/weekly/$1/public_html/index.* /home2/$1/public_html/
sudo chown $1.$1 /home/$1/public_html/index.*
sudo chown $1.$1 /home2/$1/public_html/index.*
sudo rm -rf /backup/cpbackup/weekly/$1
Note: the users " user names" I have can be pasted in the code or called from another file ..
i have this in a file like:
Not as that Much Expert
I'm just a "LostEagle"