SIMULATION -
Create a backup file named /root/backup.tar.bz2, which contains the contents of /usr/local, bar must use the bzip2 compression.
SIMULATION -
Create a backup file named /root/backup.tar.bz2, which contains the contents of /usr/local, bar must use the bzip2 compression.
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.
Archive through bzip2 in a current dir: tar -jcvf backup.tar.bz2 /usr/local Extract: mkdir /test tar -jxvf backup.tar.bz2 -C /test
# tar cvf backup.tar /usr/local #bzip2 backup.tar