Where's your backup file gone with the second version?
The first trial with tee fails because the files' names are listed to stderr, which doesn't make it into tee, and which you redirect in version 2. Still, you don't have the files on screen AND in testoutput as desired.
With the second version, I will not see any output on the screen , it will be redirected to the file.
Code:
root@clodb:/clodbvg>ls -ltra
total 16417272
drwxr-xr-x 2 root system 256 May 22 00:46 lost+found
-rw-r--r-- 1 root system 12976636 Jun 12 00:28 testoutput.txt
-rw-r--r-- 1 root system 5885143569 Jun 12 00:28 bkp_21MAY16_oratech.tgz
root@clodb:/clodbvg>tail -n3 testoutput.txt | more
/opt/freeware/bin/tar: Removing leading `/' from member names
/oratech/
/oratech/.TTauthority
/oratech/.Xauthority
/oratech/.dt/
/oratech/.dt/Desktop/
/oratech/.dt/Trash/
/oratech/.dt/Trash/.trashinfo
/oratech/.dt/appmanager/
/oratech/.dt/errorlog
/oratech/.dt/help/
/oratech/.dt/help/oraprod-oradb-0/
/oratech/.dt/help/oraprod-oradb-0/browser.hv
/oratech/.dt/help/oraprod-oradb-0/browser00.ht
/oratech/.dt/help/oraprod-oradb-0/browser01.ht
root@clodb:/clodbvg>tail -n3 testoutput.txt
/oratech/smit.script
/oratech/smit.transaction
/oratech/test1
now trying with your version
Code:
root@clodb:/clodbvg>bash
root@clodb:/clodbvg>tar cvf - /oratech 2> >(tee ZZ /dev/tty) | gzip > testversion.tgz
a /oratech
a /oratech/.TTauthority 1 blocks.
a /oratech/.Xauthority 1 blocks.
a /oratech/.dt
a /oratech/.dt/Desktop
a /oratech/.dt/Trash
a /oratech/.dt/Trash/.trashinfo 0 blocks.
a /oratech/.dt/appmanager
a /oratech/.dt/errorlog 1 blocks.
a /oratech/.dt/help
a /oratech/.dt/help/oraprod-oradb-0
a /oratech/.dt/help/oraprod-oradb-0/browser.hv 2 blocks.
root@clodb:/clodbvg>cat ZZ
a /oratech
a /oratech/.TTauthority 1 blocks.
a /oratech/.Xauthority 1 blocks.
a /oratech/.dt
a /oratech/.dt/Desktop
a /oratech/.dt/Trash
a /oratech/.dt/Trash/.trashinfo 0 blocks.
a /oratech/.dt/appmanager
a /oratech/.dt/errorlog 1 blocks.
a /oratech/.dt/help
a /oratech/.dt/help/oraprod-oradb-0
a /oratech/.dt/help/oraprod-oradb-0/browser.hv 2 blocks.
a /oratech/.dt/help/oraprod-oradb-0/browser00.ht 3 blocks.
a /oratech/.dt/help/oraprod-oradb-0/browser01.ht 0 blocks.
Now trying the files which had error
Code:
root@clodb:/clodbvg>tar cvf - /oradata/proddata/applsys*.* 2> >(tee errorfiles.txt /dev/tty) | gzip > errorfiles.tgz
a /oradata/proddata/applsysd01.dbf 6963216 blocks.
a /oradata/proddata/applsysd02.dbf 14680080 blocks.
/oradata/proddata/applsysd02.dbf: There is an input or output error.
tar: 0511-182 Read error on a /oradata/proddata/applsysd03.dbf 13107216 blocks.
a /oradata/proddata/applsysd04.dbf 4505616 blocks.
a /oradata/proddata/applsysd05.dbf 4505616 blocks.
a /oradata/proddata/applsysx01.dbf 4915216 blocks.
a /oradata/proddata/applsysx02.dbf 7987216 blocks.
The error is only on applsysd02.dbf and not applsysd03.dbf
Code:
root@clodb:/clodbvg>/opt/freeware/bin/tar cvf - /oradata | gzip > /clodbvg/bkp_30MAY16.tgz
/opt/freeware/bin/tar: Removing leading `/' from member names
/oradata/
/oradata/JAVA/
/oradata/JAVA/.toc
/oradata/JAVA/Java131.rte
/oradata/JAVA/Java131.rte.tar
/oradata/Stage11i/
/oradata/lost+found/
/oradata/proddata/
/oradata/proddata/XDOD.dbf
/oradata/proddata/XDOX.dbf
/opt/freeware/bin/tar: /oradata/proddata/applsysd02.dbf: Read error at byte 4767080960, reading 10240 bytes: There is an input or output error.
/oradata/proddata/applsysd03.dbf
/oradata/proddata/applsysd04.dbf
/oradata/proddata/applsysd05.dbf
/oradata/proddata/applsysx01.dbf
/oradata/proddata/applsysx02.dbf
Thanks Rudic.
Last edited by filosophizer; 06-12-2016 at 08:03 AM..
Reason: posted the results of file which had problem when doing tar
Hi All
Can someone pls guide me if there any utility to compress file on windows & uncompress on vxworks
I tried as -
- compressed some folders on windows ... i created .tar ( to maintain directory structure ) and compressed to .gz format.
- on VxWorks i have uncompressed it to .tar... (1 Reply)
Hi all,
4 files are returned when i issue 'find . -mtime -1 -type f -ls'.
./ora_475244.aud
./ora_671958.aud
./ora_934052.aud
./ora_934050.aud
However, when I issued the below command:
tar -cvf test.tar `find . -mtime -1 -type f`, the tar file only contains the 1st file -... (2 Replies)
Hello,
I was asked by my boss to make a backup of one of our systems that is slated to be decommissioned. When I suggested if could tar the "/" directory he nodded and said that would do the trick,
When I try and execute the command I get EOF error. I think it is because there is not enough... (2 Replies)
Hi all,
I have a tar file and inside that tar file is a folder with additional tar.gz files. What I want to do is look inside the first tar file and then find the second tar file I'm looking for, look inside that tar.gz file to find a certain directory. I'm encountering issues by trying to... (1 Reply)
I have the following folder structure
code/f1/
code/lib/t1
code/lib/t2
code/lib/t3
code/lib/t3
code/lib_1/t1
code/exc
I would like to create a tar with a folder structure below and I can use the following tar command
f1
lib/t1
lib/t2
lib/t3
tar -cvf code.tar -C code f1 lib... (4 Replies)
I would like to confirm my file.tar is been tar-ed correctly before I remove them. But I have very limited disc space to untar it.
Can I just do the listing instead of actual extract it? Can I say confirm folder integrity if the listing is sucessful without problem?
tar tvf file1.tar
... (1 Reply)
Hello Team,
Would you please help me with a UNIX command that would check if file is a tar file.
if we dont have that , can you help me with UNIX command that would check if file ends with .tar
Thanks in advance. (10 Replies)
Quick question,
is it possible to make a Tar of completely directory and placing the tar file in it (will this cause even the tar file to tarred ?)
sample:
/opt/freeware/bin/tar -cvf - /oracle | gzip > /oracle/backup.tgz
will the tar file backup.tgz also include backup.tgz ?
i tried... (5 Replies)