Question

Je veux créer un tarfile à partir d'une liste de fichiers.
La liste de fichiers a deux lignes

log1.dat
log2.dat

Le script shell ressemble:

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

Tous les fichiers sont stockés dans le dossier temp/temp1.Le qshell renvoie une erreur:

no file or directory with the name inp.txt

mais le fichier est là et l'a nommé inp.txt.

L' test.tar est créé et le inp.txt est stocké dans l'archive.Je ne veux pas mettre la inp.txt dans l'archive tar - je veux stocker les fichiers répertoriés dans le inp.txt.

Ce qui va mal?

Était-ce utile?

La solution

Seul le PASE tar utilitaire accepte [ -L InputList ] en tant que paramètre.

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 ...   

Qualifier le chemin d'accès à l'utilitaire à utiliser le PASE version:

/qopensys/usr/bin/tar -cvf test.tar -L inp.txt
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top