Quote:
Originally Posted by
vathsan
I ran the below command to copy files within a partition:
svr01:root:/sunfileserver> tar -cvf *
The option "-f" gets a filename as an argument - the file/device where tar is to
store the archive. If you enter an asterisk there your declare every file/directory in your current directory (this is what "*" expands to) as a
target, not a source. Chances are your never wrote to your tape drive at all. Do the following to write everything in directory /some/start/directory and below to your tape:
tar -cvf /dev/rmt0 /some/start/directory
Alternatively, make this directory your current directory and run tar using a shell glob:
cd /some/start/directory
tar -cvf /dev/rmt0 *
The difference is that in the first case the paths are stored absolutely, n the second case they are stored relatively. If you would list the contents of the archive you would get
/some/start/directory/fileA
/some/start/directory/fileB
/some/start/directory/dirA
/some/start/directory/dirA/fileC
... etc.
In the second case you would get
./fileA
./fileB
./dirA
./dirA/fileC
... etc.
If you intend to restore the archive always into the same directory use the first version with the absolute paths. If you intend to restore the archives into different hierarchies (maybe on another machine where /some/start/directory is named /another/dir) use the second variation.
I hope this helps.
bakunin