Exam EX200 All QuestionsBrowse all questions from this exam
Question 38

SIMULATION -

Create a backup -

Create a backup file named /root/backup.tar.bz2, contains the content of /usr/local, tar must use bzip2 to compress.

    Correct Answer:

    To create a backup file named /root/backup.tar.bz2 containing the contents of /usr/local and compressed using bzip2, you should use the following steps: You don't need to change directories. First, use the tar command with the -jcvf options. -j tells it to use bzip2, -c is for create, -v is for verbose which lists the files being processed, and -f specifies the archive file name. The command should be: tar -jcvf /root/backup.tar.bz2 /usr/local. To check the content, you can optionally use tar -jxvf /root/backup.tar.bz2 -C /test after creating a test directory with mkdir /test.

Discussion
adolfoale

# tar -cjvf /root/backup.tar.bz2 /usr/local

lordstans

This is the right answer

gunwantk

Simple to understand and execute, [root@station ~]# yum install bzip2 [root@station ~]# tar -cvf /root/backup.tar /usr/local/ [root@station ~]# du -sh /root/backup.tar 20K /root/backup.tar [root@station ~]# bzip2 /root/backup.tar [root@station ~]# du -sh /root/backup.tar.bz2 4.0K /root/backup.tar.bz2 [root@station ~]#

Hmenu0s

I don't think this is right answer as the question explicitly asks "tar must use bzip2 to compress". Apart from that the answer provided is perfectly valid.

VforVodoo

file /root/backup.tar.bz2 ##to check file information, it should show "bzip2 compressed data..."

Hammer84

tar -cjf /root/backup.tar.bz2 /usr/local

brahmimedamine

can you explain more please

Ares23

tar -cvf /root/backup.tar /usr/local && bzip2 /root/backup.tar

ms200

# tar -cjvf /root/backup.tar /usr/local # bzip2 backup.tar

Gustavo_13

tar -jcvf /root/backup.tar.bz2 /usr/local

Rizos

Answer for RHEL8 # cd /usr/local # tar -jcvf /root/backup.tar.bz2 /usr/local # mkdir /test # tar -jxcf /root/backup.tar.bz2 -C /usr/local If you do it the way the original answer says it will return the "cowardly refusing" error

Rizos

Last command should be: tar -jxcf /root/backup.tar.bz2 -C /test

hitode

#tar -cavf /root/backup.tar.bz2 /usr/local