Home » Education » Automate Backup in Linux Using RSYNC & Crontab | Backup Data On Remote Server Using RSYNC

Automate Backup in Linux Using RSYNC & Crontab | Backup Data On Remote Server Using RSYNC

Written By Nehra Classes on Sunday, Jun 14, 2020 | 12:03 PM

 
#Welcome to Nehra Classes Youtube Channel# #Automate Backup Using rsync & crontab in Linux# ============================================ rsync or remote synchronization is a software utility for Unix-Like systems that efficiently sync files and directories between two hosts or machines. One of them being the source or the local-host from which the files will be synced, the other one being the remote-host, on which synchronization will take place. There are basically two ways in which rsync can copy/sync data: Copying/syncing to/from another host over any remote shell like ssh, rsh. Copying/Syncing through rsync daemon using TCP. ============================================ Server: (192.168.1.111) # yum repolist # rpm -qa | grep rsync # yum install rsync -y # rpm -qi rsync # su - vikasnehra # mkdir backup # cd backup # touch test{1..10}.txt # mkdir -p /tmp/backup # rsync --help # rsync -v /home/vikasnehra/backup/* /tmp/backup/ # exit # mkdir -p /backupsource/ # cd /backupsource/ ; touch test{1..10}.txt CLIENT: (192.168.1.108) # yum repolist # rpm -qa | grep rsync # yum install rsync -y # mkdir -p /backupdestination/ Go To SERVER: # rsync -av -e ssh /backupsource/ [email protected]:/backupdestination/ Go To CLIENT: # cd /backupdestination/ # ls -lha # rm -rf * # ls -lha /root/.ssh/ # mkdir -p /root/.ssh/ # chmod 700 /root/.ssh/ # touch /root/.ssh/authorized_keys # chmod 600 /root/.ssh/authorized_keys Go To SERVER: # ssh-keygen # scp -r /root/.ssh/id_rsa.pub [email protected]:/root/.ssh/authorized_keys # date # crontab -e 25 20 * * * bash /root/backup.sh # vim /root/backup.sh !#/bin/bash /usr/bin/rsync -av -e ssh /backupsource/ [email protected]:/backupdestination/ # crontab -l # tail -f /var/log/cron Go To CLIENT: # ll /backupdestination/ === Thanks for watching the video. If it helped you then, please do like & share it with others as well. Feel free to post your queries & suggestions, we will be glad to answer your queries. If you like our hard work then do subscribe to our channel & turn on the bell notification for latest updates. === Our Some Popular Videos: Yum Server RHEL 7: https://www.youtube.com/watch?v=-N09WSCNcso DNF/Yum Server RHEL 8: https://www.youtube.com/watch?v=cXqL5lLHM_o Puppet Configuration: https://www.youtube.com/watch?v=uBLMcTuaiUw&t=34s Startis File System in RHEL 8: https://www.youtube.com/watch?v=wkLmgeo7oxk Concept of All RAID Levels: https://www.youtube.com/watch?v=VRx0copTNr8 Configure RAID-0 in Linux: https://www.youtube.com/watch?v=5tTHGbSqSKA Configure RAID-1 in Linux: https://www.youtube.com/watch?v=x12pMJpGGmw Configure RAID-5 in Linux: https://www.youtube.com/watch?v=Cj-je1RUJgo Configure RAID-6 in Linux: https://www.youtube.com/watch?v=qeKLlrZ5fLg Configure RAID-10 in Linux: https://www.youtube.com/watch?v=DLVGj_Mu1DA Migrate LVM: https://www.youtube.com/watch?v=B2YMDlYf-_U LVM Snapshot: https://www.youtube.com/watch?v=CJJwbnFuM5A === Contact Us: Vikas Nehra's Twitter Handle:👇 http://bit.ly/VikasNehraTwitterHandle Registration:👇 http://bit.ly/NehraClassesRegForm Twitter Handle:👇 http://bit.ly/NehraClassesTwiiterHandle Facebook Page:👇 www.facebook.com/nehraclasses Instagram:👇 https://www.instagram.com/nehraclasses/ Webpage:👇 http://bit.ly/NehraClassesWebpage Telegram Channel: 👇 https://t.me/NehraClasses WhatsApp Us: 👇 https://bit.ly/2Kpqp5z Email Us:👇 Email: [email protected] === ©COPYRIGHT. ALL RIGHTS RESERVED.