77 Backup and Compression in Linux demo | tar+gzip | tar+bzip2 | tar+gunzip | tar+bunzip2
Автор: TechTrends with Vipin Gupta
Загружено: 2020-10-12
Просмотров: 278
How to take backup in Linux. How to use tar utility. How to restore from backup. How to take backup of all the user. How to automatically take backup during logout. How to combine tar and gzip. How to combine tar and bzip2. How to combine tar and gunzip. How to combine tar and bunzip2. What is full backup and incremental backup.
Using tar:
Tar means tape archive. apes were the preferred media for backups in early days. For understanding the concept of backup we will create certain files in “test” directory.
$ tar cvf test.tar test
(create the backup in “test.tar” file)
the syntax is
tar options backup-file directory-to-be-backed-up
$ tar xvf test.tar
(restore from backup)
option meaning
c create
v verbose
f use file for archive
x extract
u update
t list the contents of archive without extracting
z compress with gzip
j compress with bzip2
$ tar uvf test.tar test
(update the archive)
$ tar tvf test.tar
(list the contents of archive without actually extracting the contents)
$ tar cf test1.tar test
$ tar cf test2.tar test
(create 2 more tar files)
$ gzip test1.tar
$ bzip2 test2.tar
(compress the “test1.tar” with gzip, the output is in “tar.gz” format, compress the “test2.tar” with bzip2, the output is in “tar.bz2” format. it greatly reduces the size of tar files)
We have to create/restore in 2 steps. During creation, first tar and then compress. During restore, first decompress and then use tar.
Using tar with gzip and bzip2:
We want to perform both processes in one step
tar + gzip:
$ tar cvfz test.tar.gz test
(create tar with gzip compression. you have to specify the filename properly with gz extension. “z” denotes gzip compression)
tar + bzip2:
$ tar cvfj test.tar.bz2 test
(create tar with bzip2 compression. you have to specify the filename properly with bz2 extension. “j” denotes bz2 compression)
Using tar with gunzip and bunzip2:
tar + gunzip:
$ tar xvfz test.tar.gz
(unzip and extract. “z” denotes “gunzip”)
tar + bunzip2:
$ tar xvfj test.tar.bz2
(unzip and extract. “j” denotes “bunzip2”)
How to take backup of all users:
all the users resides in “/home” directory. so as a “root” user, take backup of home directory
tar cvfz home.tar.gz /home
How to take backup at logout:
the trick lies in properly using “.bash_logout” file.
Courses Available in English at
Docker Hands-On
https://www.udemy.com/course/docker-h...
Practice Tests | Test Your Kubernetes Skills
https://www.udemy.com/course/test-you...
6 Practice Exams | AWS Certified Cloud Practitioner CLF-C02
https://www.udemy.com/course/practice...
Kubernetes for Absolute Beginners - Hands-on
https://www.udemy.com/course/kubernet...
Amazon Web Services (AWS) - Hands On
https://www.udemy.com/course/hands-on...
Mastering BIND DNS Course
https://www.udemy.com/course/masterin...
Mastering Iptables Firewall Course
https://www.udemy.com/course/masterin...
IP Addressing and Subnetting: Practical Approach Course
https://www.udemy.com/course/ip-addre...
Apache Web Server Course
https://www.udemy.com/course/apache-w...
Kubernetes For Beginners Course
https://www.udemy.com/course/k8s-for-...
Software Defined Networking (SDN) Made Simple Course
https://www.udemy.com/course/sdn-made...
Mastering Docker Course
https://www.udemy.com/course/docker-m...
Linux Command Line For Beginners Course
https://www.udemy.com/course/linux-es...
Kubernetes Hands On Course
https://www.udemy.com/course/kubernet...
https://www.udemy.com/course/aws-cert...
Linux Networking For Beginners
https://www.udemy.com/course/linux-ne...
Squid Proxy Server
https://www.udemy.com/course/squid-pr...
#linux #linuxcommands #linuxforbeginners #centos7 #centos #linuxadministration #linux_tutorial #vipingupta #techtrendswithvipingupta #opensource #opensourcesoftware #linuxoperatingsystem #linuxos #operatingsystem #linuxinhindi #filesystem #commandstutorial #command #commands #filesystem #linuxadmin #linuxadministration #zip #backup #restore
Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: