1830045 Members
15266 Online
109998 Solutions
New Discussion

restore file

 
SOLVED
Go to solution
peterchu
Super Advisor

restore file

I use "tar" to backup the files to the tape , tar xvf /dev/st0 /tmp/*.txt , it can successfully backup all the files,


/tmp/a1.txt
/tmp/a2.txt
/tmp/a3.txt
/tmp/a4.txt
/tmp/a5.txt

I tried to use the below command to restore it, but all are fail ,
tar tar xvf /dev/st0 /tmp/*.txt ,
tar tar xvf /dev/st0 /tmp/a*.txt
tar tar xvf /dev/st0 /tmp/*

I have to restore it file by file , the below is ok
tar tar xvf /dev/st0 /tmp/a1.txt
tar tar xvf /dev/st0 /tmp/a2.txt
tar tar xvf /dev/st0 /tmp/a3.txt

, could suggest how can I restore by one time ? thx
3 REPLIES 3
Stuart Browne
Honored Contributor

Re: restore file

Did you try:

tar xvf /dev/st0 "/tmp/*.txt"
One long-haired git at your service...
peterchu
Super Advisor

Re: restore file

it is OK , thx
Jeroen Peereboom
Honored Contributor
Solution

Re: restore file

L.S.

What output is shown when you restore? You use verbose mode, so some output should be shown.

If you didn't remove ALL txt files before restoring, your problem is quoting.

If you type 'tar xvf /dev/sto /tmp/*.txt' the shell will do a filename expansion on /tmp/*.txt, and restore these files. So assuming you did not remove all files, this will expand to the filenames still present on your system, and restoring these files.
You should type tar xvf /des/st0 '/tmp/a*.txt'.

JP.