UnixServerAdmin

Server Administration & Management

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 »

  1. Thank you for finding the time to line all this out for people like us. This article ended up being really helpful to me.

    Comment by Vincenza Vehrs | June 15, 2011 | Reply

  2. Thanks a lot for finding the time to line all this out for people like us. This particular article has been incredibly helpful if you ask me.

    Comment by Junior Fenix | June 15, 2011 | Reply

  3. I’d personally love to hear everything you know regarding this subject matter. You only have scraped the surface of your respective knowledge on this and that is obvious in the way you blog. Have you thought about dedicating an entire site to ensure that others won’t miss that which you have to say?

    Comment by filtered water | June 15, 2011 | Reply

  4. Anytime I study a subject I’ve no clue what i will discover. I am so very happy to have stumbled upon your comprehensive blogging since it correctly details the concerns I have under consideration and also the unspoken issues which i would’ve looked for in the future.

    Comment by amazing water blog | June 16, 2011 | Reply

  5. good start

    Comment by BrurfBani | September 11, 2011 | Reply


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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s

%d bloggers like this: