#!/bin/sh # # nodumptgz: Mark all files in a tgz archive with ext2 "nodump" # flag, since they're recoverable from the tgz file. Be sure to remove # the -d- flag from config files that you modify! # # # Usage: # nodumprtgz FILE.tgz # Be sure your current directory is set correctly for relative paths in the tgz! # # Note: # If a full restore is needed, you need some way to determine which # packages need reloading. # We must remove directories, since +d for a directory is inherited by files # created in the future tar ztf $* \ | xargs ls -ld \ | grep -v '^d' \ | cut -c57- \ | xargs chattr +d