PDA

View Full Version : backup script does not work properly



mozkaynak
December 28th, 2006, 12:41 AM
Hi,
I created the following easy script:


#! /bin/bash
echo backup is starting
cd /home/mozkaynak
tar cvpzf /media/usbdisk/homebackup.tgz ./ --exclude=./.gnome2/epiphany/* --exclude=./.mozilla/firefox/* --exclude=./realplayer10/*
tar cvpzf /media/usbdisk/etcbackup.tgz /etc

echo backup is done. Now testing
tar tzvf /media/usbdisk/homebackup.tgz
tar tzvf /media/usbdisk/etcbackup.tgz

sudo umount /media/usbdisk

it works fine except exclude part. this does not exclude anything.
does anybody know what might be the reason?
Any other improvement suggestions are welcome too.

Thanks in advance.

slavik
December 28th, 2006, 03:36 PM
I think you have to do excludes before providing the directory to compress, as the object to work on is usually the last argument.