74 tar for backup and restore in Linux | Linux Tutorial | Linux Commands | Linux for Beginners

preview_player
Показать описание
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.

the syntax is
tar options backup-file directory-to-be-backed-up

(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

(update the archive)

(list the contents of archive without actually extracting the contents)

(create 2 more 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:

(create tar with gzip compression. you have to specify the filename properly with gz extension. “z” denotes gzip compression)

tar + bzip2:

(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:

(unzip and extract. “z” denotes “gunzip”)

tar + bunzip2:

(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

How to take backup at logout:

the trick lies in properly using “.bash_logout” file.

Courses Available at

Docker Hands-On

Docker in Hindi

Linux in Hindi

Kubernetes for Absolute Beginners - Hands-on

Practice Tests | Test Your Kubernetes Skills

AWS Certified Cloud Practitioner (CLF-C01) - Hands On

Amazon Web Services (AWS) - Hands On

Mastering BIND DNS Course

Mastering Iptables Firewall Course

IP Addressing and Subnetting: Practical Approach Course

Apache Web Server Course

Kubernetes For Beginners Course

Software Defined Networking (SDN) Made Simple Course

Linux Command Line For Beginners Course

Kubernetes Hands On Course

#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
Рекомендации по теме
welcome to shbcf.ru