Selasa, 16 Agustus 2016

How To Practise Backup Of All User's Dwelling Directory In Addition To Relieve Every 2Nd Individually

This is how to blog, Create Backup of User's domicile directory as well as give-up the ghost along a variety out compress file for each user.

For a System Administrator is required to give-up the ghost along the backup of Data to avoid unnecessary recovery or Disaster.

Requirement -

1- Linux box - In my scenario, I am using Centos 6.4 lastly release.
2- TAR utility.

Step 1 -

Create Backup finish directory or Mount NAS. In my scenario, I am using my local / rootage subdivision for demonstration.
[root@cent  ]#  mkdir /backupdir

Step ii - 

Create #!/bin/bash Script to practice backup as well as electronic mail report.
Create Script file using Vi editor

[root@cent backupdir]# vi homebackup.sh

#!/bin/bash # Add your backup dir location, as well as tar commmand path DATE=`date +%d_%m_%Y_%H_%M` # Define Backup Directory BACKUP_DIR="/backupdir" # To practice a novel directory into backup directory place mkdir -p $BACKUP_DIR/$DATE  # List all Folder available within /home directory USERS=`ls /home | xargs -r` for user inwards  $USERS; practice tar -czf $BACKUP_DIR/$DATE/$user.tar.gz /home/$user # Create log file for all folder comes inwards backup ls -l $BACKUP_DIR/$DATE | truthful cat > $BACKUP_DIR/$DATE/$DATE.log done  

Save as well as Exit from Script

Step three -
Make Script Executable.
[root@cent backupdir]# chmod a+x homebackup.sh

Step four -

Run Script to cheque exam - If everything goes good output should similar this -

[root@cent backupdir]# ./homebackup.sh


We bring successfully configured Backup of folder every bit compress as well as report.


That's All
!!!Cheers!!!

Sumber https://linuxhowtoguide.blogspot.com/

Tidak ada komentar:

Posting Komentar