EX200 Exam QuestionsBrowse all questions from this exam

EX200 Exam - Question 108


SIMULATION -

Create a backup file named /root/backup.tar.bz2, which contains the contents of /usr/local, bar must use the bzip2 compression.

Show Answer
Correct Answer:

To create a backup file named /root/backup.tar.bz2, which contains the contents of /usr/local and uses bzip2 compression, you should use the tar command with the required options. The command to achieve this is: tar -cjvf /root/backup.tar.bz2 /usr/local. Here, '-c' is to create an archive, '-j' is to use bzip2 compression, '-v' for verbose to show the process, and '-f' specifies the filename of the archive being created. The directory '/usr/local' is the source directory to be archived and compressed. You do not need to change directories to create the archive.

Discussion

2 comments
Sign in to comment
STFN2019
Sep 28, 2021

Archive through bzip2 in a current dir: tar -jcvf backup.tar.bz2 /usr/local Extract: mkdir /test tar -jxvf backup.tar.bz2 -C /test

hareshrajpara
Apr 29, 2021

# tar cvf backup.tar /usr/local #bzip2 backup.tar