Thanks SEA, so it is important to exclude the file, which means that Tar backup will include the newly backuped tar file into tar
so, let try it this way,
put the file in a directory called /nobackup
am i right ?
Table 1. Required Flags
Required Flags Description
-c Creates a new archive and writes the files specified by one or more File parameters to the beginning of the archive.
-f Archive Uses the Archive variable as the archive to be read or written. When this flag is not specified, the tar command uses a system-dependent default file name of the form /dev/rmt0. If the Archive variable specified is - (minus sign), the tar command writes to standard output or reads from standard input. If you write to standard output, the -c flag must be used.
-v Lists the name of each file as it is processed. With the -t flag, -v gives more information about the tape entries, including file sizes, times of last modification, User Number (UID), Group Number (GID), and permissions.
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 ?)
Yes, that is possible - it is just not worth the hassle.
Quote:
Originally Posted by filosophizer
will the tar file backup.tgz also include backup.tgz ?
Without taking precautions: yes, it will, although in an incomplete and unusable form.
Note that this here is the AIX-forum and hence i suppose you use AIX as your OS. The AIX tar (as opposed to the GNU tar) does NOT know the suggested "--exclude" option , because it is not required by POSIX. This means the suggested solution will not not work in AIX as long as you are not willing to install a lot of (GNU-)software.
You can achieve the same using some find-statement to produce a list of file names in the directory minus the one with the name of the tar-file itself and feed that into tar. But, frankly: wouldn't be writing the tar-file elsewhere and finally moving it be a lot easier? In principle it is possible to walk from Europe to China on your hands, but: an airplane will get you there as well and it will be less tedious.
If you think about backing up your database that way, be warned: tar follows the ustar-standard and this limits the single input file to 8G of size. Therefore tar is a poor tool for database backups. (btw: cpio does the same). For the backup of Oracle databases consider using the Oracle-framework called RMAN and some backup tool. You need it anyway because you need to constantly shovel the archive logs off the machine when the DB is running.
I think that /oracle is not a database but an ORACLE_HOME hopefully
Nevertheless you might want to consider using pax if you don't have GNU tar
Will shall change directory to /oracle and create archive of current directory (.) using the pax substitute to exclude the backup.tar file itself. After it is done we shall return to previous working directory (-).
You will be able to extract the tar file using tar or pax on any operating system, but limits Bakunin mentioned still apply.
If you use pax archive format when using the pax utility, the file size limits from the tar and cpio archive formats are removed. So with:
files of any size can be archived as long as there is enough space in the filesystem where the archive is being written to hold the entire archive.
This might even work without the -x pax option; the standards don't specify which archive format is used when creating an archive when the -x option is not specified on the command line.
Coming from this thread, just wondering if there is an option to check if the Tar of the files/directory will be without any file-errors without actually making the tar.
Scenario:
Let's say you have a directory of 20GB, but you don't have the space to make Tar file at the moment, and you want... (14 Replies)
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)
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)
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)
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)
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,
if I have a tarfile called pmapdata.tar that contains
tar -tvf pmapdata.tar
-rw-r--r-- 0/0 21 Oct 15 11:00 2009 /var/tmp/pmapdata/pmap4628.txt
-rw-r--r-- 0/0 21 Oct 14 20:00 2009 /var/tmp/pmapdata/pmap23752.txt
-rw-r--r-- 0/0 1625 Oct 13 20:00 2009... (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)
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)