During a weekly maintenance window you must launch a GNU tar command that will create a new incremental backup of the /srv/www directory. The command must:
Include only files that have changed since the last run by referencing the snapshot file /var/lib/backup/www.snar.
Compress the archive with gzip.
Write the archive to /backups/www-$(date +%F).tar.gz.
Display the names of the files as they are added.
Which command meets all of these requirements?
tar -cvjf /backups/www-$(date +%F).tar.bz2 --listed-incremental=/var/lib/backup/www.snar /srv/www
tar -cvzf /backups/www-$(date +%F).tar.gz --listed-incremental=/var/lib/backup/www.snar /srv/www
tar -cvzf /backups/www-$(date +%F).tar.gz -N /var/lib/backup/www.snar /srv/www
tar -czf /backups/www-$(date +%F).tar.gz --incremental=/var/lib/backup/www.snar /srv/www
Use -f immediately followed by the desired archive file name.
Use --listed-incremental=/var/lib/backup/www.snar (or its short form -g /var/lib/backup/www.snar) so that only files that have changed since the previous run are included and deletions are tracked.
The command tar -cvzf /backups/www-$(date +%F).tar.gz --listed-incremental=/var/lib/backup/www.snar /srv/www satisfies every one of these requirements.
Each alternative fails at least one point:
A command that substitutes -j for -z compresses with bzip2, not gzip.
A command that tries --incremental=/var/lib/backup/www.snar both supplies an unsupported argument to --incremental and omits -v, so file names would not be displayed.
A command that relies on -N /var/lib/backup/www.snar merely compares timestamps; it does not use the snapshot file for true incremental tracking and would ignore deletions.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is a tar snapshot file, and how does it enable incremental backups?
Open an interactive chat with Bash
Why is gzip compression specified with -z in the tar command?
Open an interactive chat with Bash
How does the $(date +%F) command work in tar, and why is it used?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
System Management
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access