home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


UNIX Power Tools

UNIX Power ToolsSearch this book
Previous: 20.6 Writing a Tape Drive on a Remote Machine Chapter 20
Backing Up Files
Next: 20.8 Telling tar Which Files to Exclude or Include
 

20.7 Creating a Timestamp File for Selective Backups

Whenever I upgraded to a new version of UNIX, one common problem was making sure I maintained all of the changes made to the standard release of UNIX. Previously, I did an ls -lt (16.2 ) in each directory, and then I examined the modification date. The files that were changed have an obviously newer date than the original programs [unless the changed files come from a tar archive, with their original modification dates preserved! -JP  ] Even so, finding every change was tedious, as there were dozens of directories to be searched.

A better solution is to create a file as the first step in upgrading. I usually call this FirstFile . find has a -newer option (17.8 ) that tests each file and compares the modification date to the newer file. If you then wanted to list all files in /usr that need to be saved when the operating system is upgraded, use:

% find /usr -newer /usr/FirstFile -print

This could then be used to create a tar (19.5 ) or cpio (19.9 ) file that would be restored after the upgrade.

- BB


Previous: 20.6 Writing a Tape Drive on a Remote Machine UNIX Power Tools Next: 20.8 Telling tar Which Files to Exclude or Include
20.6 Writing a Tape Drive on a Remote Machine Book Index 20.8 Telling tar Which Files to Exclude or Include

The UNIX CD Bookshelf NavigationThe UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System