[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: backup script modification help



On 04 Jun 2007 07:15:49 -0400, Haines Brown <brownh@hartford-hwp.com> wrote:
I use cron to do a periodic full backup to an external USB drive that
I've named "mirror". The script used is:

find / -print | egrep -v "^/media/mirror|^/proc" | cpio -pdmuv
/media/mirror/"$1" 2>&1 | cat -vt

Since installing Etch, this script has not worked well because it does
not like to backup the /sys directory. Actually, backing up /sys
dangerous). So I'd like to modify the script to block cpio from doing
/sys as it avoids /proc, but not sure how. Help would be appreciated.

I suppose like this

find / -print | egrep -v "^/media/mirror|^/proc|^/sys" | cpio -pdmuv
/media/mirror/"$1" 2>&1 | cat -vt

It would be good if you would understand this command a bit :)

Find locates all files and gives list of them. Egrep (or grep) does
matching on filenames (-v means inverse), and matches either of
/media/mirror, /proc or /sys at beginning of line. Then list of those
filenames is passed to cpio and it just archives them.

Regards,
Atis



Reply to: