UnixServerAdmin

Server Administration & Management

How to take backup of a account without its home diretcory in cPanel

What if you want to generate the account backup without the home diretcory, Here is the command to exclude/skip home diretcory

# /scripts/pkgacct –skiphomedir username

Note :: Here username is  actual cPanel username.

Advertisements

June 18, 2011 Posted by | cPanel | , , | Leave a comment

backup_remote.sh

#############################################################
## backup_remote.sh ##
#############################################################
## Script for Data Backup Transfer on Remote Server by rsync ##
#############################################################
## Make a Directory /REPORTS ##
## Make a file msg.txt under /REPORTS Directory ##
## Write Following in msg.txt file ##
#############################################################
## Hi, ##
## The Backup Report of the  server is attached with this mail. ##
## Thanks & Regards, ##
## Unixserveradmin.com Security Team ##
#############################################################
## X.X.X.X –> Remote Server IP Address ##
## ssh -p 8765 –> SSH Port No. 8765 ##
#############################################################
#! /bin/bash

/bin/echo “========================================================” > /REPORTS/Backup.log_$(date +%d%m%y)
/bin/echo “THE BACKUP IS STARTED AT $(date)” >> /REPORTS/Backup.log_$(date +%d%m%y)
/bin/echo “========================================================” >> /REPORTS/Backup.log_$(date +%d%m%y)
/bin/echo ”      ” >> /REPORTS/Backup.log_$(date +%d%m%y)
/bin/echo ”      ” >> /REPORTS/Backup.log_$(date +%d%m%y)
/bin/echo “========================================================” >> /REPORTS/Backup.log_$(date +%d%m%y)
/bin/echo “BACKUP LOGS ARE AS FOLLOWS:”  >> /REPORTS/Backup.log_$(date +%d%m%y)
/bin/echo “——————————————————–”  >> /REPORTS/Backup.log_$(date +%d%m%y)
/usr/bin/rsync -avh -e “ssh -p 8765 –delete-after” /disk2/daily X.X.X.X:/disk3/ >> /REPORTS/Backup.log_$(date +%d%m%y)
/bin/echo “——————————————————–” >> /REPORTS/Backup.log_$(date +%d%m%y)
/bin/echo “========================================================” >> /REPORTS/Backup.log_$(date +%d%m%y)
/bin/echo “THE BACKUP HAS BEEN COMPLETED AT $(date)” >> /REPORTS/Backup.log_$(date +%d%m%y)
/bin/echo “========================================================” >> /REPORTS/Backup.log_$(date +%d%m%y)

mutt -s “REMOTE_BACKUP REPORT $(hostname | tr ‘a-z’ ‘A-Z’)” -a /REPORTS/Backup.log_$(date +%d%m%y) unixserv@unixserveradmin.com < /REPORTS/msg.txt

mutt -s “REMOTE_BACKUP REPORT $(hostname | tr ‘a-z’ ‘A-Z’)” -a /REPORTS/Backup.log_$(date +%d%m%y) info@unixserveradmin.com < /REPORTS/msg.txt

May 7, 2011 Posted by | Shell Script | , , | 5 Comments