What Is in the Archive?

When you have an archive on a removable device, you might not know what is on it. Perhaps you are using a multiple-level backup scheme and you don't know which day the file was backed up. Both tar and cpio offer a way of creating a table of contents for the tape. The most convenient time to create this TOC file, of course, is during the actual backup. The following two lines show how to perform a backup and at the same time create a table of contents file for that archive:

						$ tar cvf - / > /tmp/backup.Monday.TOC
						$ find / -print | cpio -ov > /dev/rmt0 2> /tmp/backup.Monday.TOC
					

The cpio backup automatically sends the list to standard error; therefore, this line just captures standard error and saves it as a file. By the ...

Get Red Hat® Linux® 7 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.