wanted4u
asked on
'simple' script / tar archive problem
Hi,
I've the following problem:
When I want to restore multiple files with tar i use the following syntax:
tar -xvf /mnt/usbdrive/backup/vantr iest-Fri.t ar file1.jpg file2.doc file4.jpg
because of some files have some spaces in the filenames I set the files between comments
tar -xvf /mnt/usbdrive/backup/vantr iest-Fri.t ar 'file1.jpg' 'file2.doc' 'file4.jpg' 'long filename.jpg'
this works fine .. but not in a script!?!
When I do the exact same thing at the prompt it works fine...
What do i wrong?
=-=-=-=-=-=-=-=-=-=-=-=-=- =-=-=-=-=- =-
the script
-=-=-=-=-=-=-=-==-=-=-=-=- =-=-=-=-=- =-
#!/bin/sh
cd /mnt/restore
tar -xvf /mnt/usbdrive/backup/debur g-Fri.tar 'mnt/deburg/deBurgMakelaar s/deburgma kelaars website/offertedeburg.doc' 'mnt/deburg/deBurgMakelaar s/deburgma kelaars website/Onderstaand de aanpassingen die nog uitgevoerd moeten worden.doc' 'mnt/deburg/deBurgMakelaar s/deburgma kelaars website/deburg.ppt' 'mnt/deburg/deBurgMakelaar s/deburgma kelaars website/zoekcriteria www.deburgmakelaars.nl.doc'
=-=-=-=-=-=-=-=-=-=-=-=-=- =-=-=-=-=- =-=-=-=-=-
Output
=-=-=-=-=-=-=-=-=-=-=-=
[root@backup backup]# /tmp/commands.sh
mnt/deburg/deBurgMakelaars /deBurgMak elaars website/offertedeburg.doc
tar: mnt/deburg/deBurgMakelaars /deBurgMak elaars website/offertedeburg.doc: Cannot open: No such file or directory
mnt/deburg/deBurgMakelaars /deBurgMak elaars website/Onderstaand de aanpassingen die nog uitgevoerd moeten worden.doc
tar: mnt/deburg/deBurgMakelaars /deBurgMak elaars website/Onderstaand de aanpassingen die nog uitgevoerd moeten worden.doc: Cannot open: No such file or directory
mnt/deburg/deBurgMakelaars /deBurgMak elaars website/deburg.ppt
tar: mnt/deburg/deBurgMakelaars /deBurgMak elaars website/deburg.ppt: Cannot open: No such file or directory
mnt/deburg/deBurgMakelaars /deBurgMak elaars website/zoekcriteria www.deburgMakelaars.nl.doc
tar: mnt/deburg/deBurgMakelaars /deBurgMak elaars website/zoekcriteria www.deBurgMakelaars.nl.doc: Cannot open: No such file or directory
=-=-=-=-=-=-=-=-=-=-=-=-=- =-=-=-
Thanks in advance,
V.R. Jansen
I've the following problem:
When I want to restore multiple files with tar i use the following syntax:
tar -xvf /mnt/usbdrive/backup/vantr
because of some files have some spaces in the filenames I set the files between comments
tar -xvf /mnt/usbdrive/backup/vantr
this works fine .. but not in a script!?!
When I do the exact same thing at the prompt it works fine...
What do i wrong?
=-=-=-=-=-=-=-=-=-=-=-=-=-
the script
-=-=-=-=-=-=-=-==-=-=-=-=-
#!/bin/sh
cd /mnt/restore
tar -xvf /mnt/usbdrive/backup/debur
=-=-=-=-=-=-=-=-=-=-=-=-=-
Output
=-=-=-=-=-=-=-=-=-=-=-=
[root@backup backup]# /tmp/commands.sh
mnt/deburg/deBurgMakelaars
tar: mnt/deburg/deBurgMakelaars
mnt/deburg/deBurgMakelaars
tar: mnt/deburg/deBurgMakelaars
mnt/deburg/deBurgMakelaars
tar: mnt/deburg/deBurgMakelaars
mnt/deburg/deBurgMakelaars
tar: mnt/deburg/deBurgMakelaars
=-=-=-=-=-=-=-=-=-=-=-=-=-
Thanks in advance,
V.R. Jansen
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
use escape charaters of blank spaces
eg mnt/deburg/deBurgMakelaars
actulay it is like /mnt/deburg/deBurgMakelaar