0 Members and 1 Guest are viewing this topic.
/home/testacc/test.example.com/
#!/bin/bashif [ -z "$1" ]then"username argument not exist"elseUSERNAME="$1"file="/home/cpmove-$USERNAME.tar.gz"if [ -f "$file" ]thenmkdir /home/"$USERNAME"/tmp/bkuptar -C /home/"$USERNAME"/tmp/bkup -xzf "$file" */homedir/ --exclude='*/homedir/.*' --exclude='*/homedir/bin' --exclude='*/homedir/cpanel3-skel' --exclude='*/homedir/cpanelbranding' --exclude='*/homedir/etc' --exclude='*/homedir/logs' --exclude='*/homedir/mail' --exclude='*/homedir/perl' --exclude='*/homedir/perl5' --exclude='*/homedir/public_ftp' --exclude='*/homedir/rvadmin' --exclude='*/homedir/ssl' --exclude='*/homedir/tmp'cp -rlf /home/"$USERNAME"/tmp/bkup/*/homedir/* /home/"$USERNAME"/ && rm -r /home/"$USERNAME"/tmp/bkup/*elseecho "restoration file not exist"fifi