Complete the code to create a compressed backup of the /home directory using tar.
tar [1] -czf backup.tar.gz /homeThe -c option tells tar to create a new archive.
Complete the command to synchronize the /data directory to /backup using rsync.
rsync -a [1] /backupThe source directory should be specified with a trailing slash to copy contents inside /data/.
Fix the error in the command to create an incremental backup with tar using the snapshot file.
tar -czf backup.tar.gz --listed-incremental=[1] /var/logThe snapshot file name should be a valid filename without special characters or slashes.
Fill both blanks to create a backup script that archives /etc and excludes *.tmp files.
tar [1] -czf etc_backup.tar.gz /etc --exclude=[2]
-c creates the archive, and --exclude=*.tmp skips temporary files.
Fill all three blanks to create a dictionary comprehension that maps filenames to their sizes for files larger than 1MB.
sizes = [1]: os.path.getsize([2]) for [3] in files if os.path.getsize([3]) > 1048576
This comprehension creates a dictionary with filenames as keys and their sizes as values, filtering files larger than 1MB.