/dev/sda1 is mounted on / /dev/sda2 is mounted on /home /dev/hda1 is mounted on /data1 /dev/hda2 is mounted on /data2 OS - SuSE 10.0 x86_64
# tar -cvjf /data2/sys-backup.tar.bz2 / --exclude-from=/exclude-file
/exclude_file is a text file with (directories space separated on one line): /home /data1 /data2
The tar man page describes --exclude-from=FILE should skip the entries in FILE. However, in my case tar merrily backed up /home, /data1, and /data2 i.e. ignored --exclude-from option. what the ????? There is no example of the entry format of FILE.
-- Arun Khan (knura at yahoo dot com) Finagle's fourth Law: Once a job is fouled up, anything done to improve it only makes it worse.
On Sat, Jun 03, 2006 at 05:46:07PM +0530, Arun K. Khan wrote:
/dev/sda1 is mounted on / /dev/sda2 is mounted on /home /dev/hda1 is mounted on /data1 /dev/hda2 is mounted on /data2 OS - SuSE 10.0 x86_64
# tar -cvjf /data2/sys-backup.tar.bz2 / --exclude-from=/exclude-file
/exclude_file is a text file with (directories space separated on one line): /home /data1 /data2
Try those entries in exclude-file without the leading /.
On 6/3/06, Arun K. Khan knura@yahoo.com wrote:
/dev/sda1 is mounted on / /dev/sda2 is mounted on /home /dev/hda1 is mounted on /data1 /dev/hda2 is mounted on /data2 OS - SuSE 10.0 x86_64
# tar -cvjf /data2/sys-backup.tar.bz2 / --exclude-from=/exclude-file
Why don't you use cpio instead? It gives better control over what directories to backup by piping cpio to find (with the "prune" option).
BTW, does your verision of tar backup special files as well (/dev/*) ?
Regards, NMK.
On Sat, 2006-06-03 at 21:30 +0530, Nadeem M. Khan wrote:
Why don't you use cpio instead? It gives better control over what directories to backup by piping cpio to find (with the "prune" option).
I am used to tar more than cpio. I prefer GNU tar's default behaviour of stripping the leading "/"
BTW, does your verision of tar backup special files as well (/dev/*) ?
Yes it does. See console transcript below:
# tar --version tar (GNU tar) 1.15.1 # tar -cvzf /var/tmp/devices.tar.gz /dev tar: Removing leading `/' from member names /dev/ /dev/sdb1 /dev/sdb /dev/sg1 /dev/usbdev5.3 ......... # ll /var/tmp/devices.tar.gz -rw-r--r-- 1 root root 16522 Jun 3 22:56 /var/tmp/devices.tar.gz
-- Arun Khan (knura at yahoo dot com) Hand, n.: A singular instrument worn at the end of a human arm and commonly thrust into somebody's pocket. -- Ambrose Bierce, "The Devil's Dictionary"