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

Re: tar on flash drive



On 01/19/2009 01:25 AM, postid@BasicISP.net wrote:
I have a damaged system on my laptop and am trying to salvage data, then will likely install a new system (etch or lenny, was sarge). I'd like to save the home folder and a few useful files gleaned from the etc folder, keeping permissions. I'll use a live cd to do the salvage work (lenny live, knoppix, knoppix STD or slax -- I have all available) and write to a 4GB usb flash drive.
Is this the proper syntax? I believe the -c must be first and the -f last.

tar -chpvf /mnt/sda1/homebackup.tar /mnt/hda2/home

Here's what I do:
x=`date +%y%m%d.%H%M`
stime=`date +"%F %R"`
stime_sec=`date +%s`
y=`uname -n`
backup_dev=/media/backup
dest=${backup_dev}/backups/${x}
mount -v ${backup_dev}
mkdir ${dest}
tar cvpsfj ${dest}/bkup_${y}_${x}-home.tar.bz2 \
        --recursion \
        --exclude=me/.mozilla/default/fq8axws8.slt/Cache \
	--exclude=me/.mozilla/firefox/cystlqdz.default/Cache \
	--exclude=me/.mozilla/iceweasel/8xw9tsaj.default/Cache \
        --exclude=me/.pan   \
        --exclude=me/.pan2   \
	--exclude=me/.googleearth/Cache \
        --exclude=me/.thumbnails   \
        --exclude=me/.kde/share/apps/kmail/imap \
        --exclude=me/.gqview \
        --exclude=me/.beagle \
        --exclude=me/download/av   \
        --exclude=me/download/apps_and_ISOs   \
        --exclude=me/temp   \
	--exclude=me/Documents \
	--exclude=heather/.mozilla/default/kim6buav.slt/Cache/ \
        --exclude=heather/.evolution/mail   \
        --exclude=heather/.evolution/cache   \
	--exclude=heather/.sylpheed-2.0 \
	--exclude=me/Maildir \
	--exclude=heather/Maildir \
        home/

You'll obviously have to modify it, and it may do more than you want, but it works for me...

-c is create a new archive
-h is retain symlinks but not the files to which they point
-p is preserve permissions
-v is verbose
-f is indicating that the destination file name follows immediately after

Is -h the best way to handle symlinks?
Is having the destination file on a flash drive a potential problem? On my older desktop machine running sarge drag and drop with the flash drive in K3b doesn't work well and it loaths umounting the flash drive. Sarge on the hard drive was occasionally problematic, too. Slax lists my partitions on the console as /mnt/sda1 (or /media/sda1 -- the flash drive) and /mnt/hda2 (or /media/hda2 -- it's the partition with the problem).
Your input is appreciated. Please cc me as I am not currently subcribed to the list.

--
Ron Johnson, Jr.
Jefferson LA  USA

"I am not surprised, for we live long and are celebrated poopers."


Reply to: