Domanda

Voglio creare un tarfile da un filelista.
Il filelist ha due righe

log1.dat
log2.dat
.

Lo script Shell sembra:

cd /temp/temp1 
tar -cvf test.tar -L inp.txt
.

Tutti i file sono memorizzati nella DIR temp/temp1. Il QShell getta un errore:

no file or directory with the name inp.txt
.

Ma il file è lì e denominato inp.txt.

Il test.tar viene creato e il inp.txt viene memorizzato nell'archivio. Non voglio mettere il inp.txt nel tarball - Voglio memorizzare i file elencati nel inp.txt.

Cosa sta andando storto?

È stato utile?

Soluzione

solo il Pase tar Utility accetta[ -L InputList ] come parametro.

Usage: tar -{c|r|t|u|x} [ -BdDEFhilmopRUsvw ] [ -Number ] [ -f TarFile ]            
         [ -b Blocks ] [ -S [ Feet ] | [ Feet@Density ] | [ Blocksb ] ]           
         [ -L InputList ] [-X ExcludeFile] [ -N Blocks ] [ -C Directory ] File ...

Usage: tar {c|r|t|u|x} [ bBdDEfFhilLXmNopRsSUvw[0-9] ] ]                            
         [ Blocks ] [ TarFile ] [ InputList ] [ ExcludeFile ]                     
         [ [ Feet ] | [ Feet@Density ] | [ Blocksb ] ] [-C Directory ] File ...   
.

Qualifica il percorso verso l'utilità per utilizzare la versione Pase:

/qopensys/usr/bin/tar -cvf test.tar -L inp.txt
.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top