Slide

  • LINUX

    LINUX:In 1969 AT&T made a decision to withdraw Multics and go with GECOS (General Electric Comprehensive Operating Supervisor / System), with AT & T in Bells Lab when Multics was withdrawn some of the programmers named Ken Thompson and Dennis Ritchie decided to rewrite operating system in order to support low cost computer..To Know More

    CLICK HERE

  • MICROSOFT

    MICROSOFT:Microsoft was established to develop and sell BASIC interpreters for the Altair 8800. It rose to dominate the home computer operating system market with MS-DOS in the mid-1980s,followed by the Microsoft Windows line of operating systems. To Know More

    CLICK HERE

  • CISCO

    CISCO:During the early 1980s, there was a married couple namely Len and Sandy Bosack who used to work in two different departments of computer located in Stanford University. This couple was facing problem in making their computers communicate with each other To Know More

    CLICK HERE

showinfo=1

Backup Script


Backup Script

This backup script will backup  /root directory to /backup directory. You can change the source and destination according to your wish. Once the backup is over the report will be mailed.

# mkdir  /backup
# cd  /backup
# vi   backup.sh


#!/bin/bash
NOWDATE=`date +%m%d%y`    # Sets the date variable format for zipped file: MMddyy
clear       # clears terminal window
echo
echo "Hi, $USER!" > $NOWDATE.log
echo
echo "Beginning backup of files @ `date`" >> $NOWDATE.log
echo
echo "Zipping directory structure..." >> $NOWDATE.log
echo
echo
tar   -cvzf   /backup/$NOWDATE.tar.gz    /root/* >> $NOWDATE.log
echo
echo
echo "Backup Complete!" >> $NOWDATE.log
sleep 2
SUBJECT="BACKUP REPORT"
EMAIL="admin@ittables.com"
ATTACH="/backup/$NOWDATE.log"
mail -s "$SUBJECT" "$EMAIL" < $ATTACH

:wq!  -------->  save and exit

# chmod  +x  /backup/backup.sh


You can also schedule the backup using cron  e.g

# crontab  -e

#################### backup runs on 1:01am###################
01  01  *  *  *    sh    /backup/backup.sh 
#########################################################

:wq!  ---------->  save and exit

NOTE :-  Postfix or Sendmail should be configured to receive mail......


4 comments:

Note:- Comment as: Option available to post without login select "Anonymous" from the drop down...........

For Latest Updates: Subscribe Now | | Test Your Knowledge, Take a Quiz now Click Here | | Site Best Viewed In Firefox

X