Best backup option for spanning CDR's?
Michael Bilow
mike at bilow.com
Wed Dec 13 18:19:27 EST 2000
Well, there is the obvious way:
$ if [ "`file -b /etc/motd`" == 'text' ] ; then echo YES ; fi
YES
This actually does what you want:
$ for TESTFILE in `find / -size '-300k'` ; do if [ "`file -b "$TESTFILE" |
grep -c -etext -`" -ge 1 ] ; then echo "$TESTFILE" YES ; fi ; done
Obviously, replace 'echo "$TESTFILE" YES' with something more useful.
On an ideally organized distribution, you should be able to depend upon
configuration files being in /etc, other system variable files being in
/var, and user variable files being in /home (or /root). In general,
/bin, /usr, and /sbin should contain nothing specific to your system,
usually under package management and therefore easily reinstallable.
-- Mike
On 2000-12-10 at 22:01 -0500, David Kramer wrote:
> As a side question, is there an easy way to tell whether a file is an
> ASCII text file as opposed to a binary? One backup option I am
> contemplating would be to back up all text files under 300K or so, which
> would encompass most if not all configuration files. In other words,
> back up only what I would need to make a new install work like the old
> system, given I would most likely install the OS fresh after a crash
> anyway.
-
Subcription/unsubscription/info requests: send e-mail with
"subscribe", "unsubscribe", or "info" on the first line of the
message body to discuss-request at blu.org (Subject line is ignored).
More information about the Discuss
mailing list