tar directory -C


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers tar directory -C
# 1  
Old 02-09-2010
tar directory -C

I m new to unix and trying to use tar command with -C option -

tar -cf /tmp/Test_shell/ZipTestFolder/archive10.tar -C /tmp/Test_shell/ZipTestFolder/ .

It creates one more folder no_name inside the tar file. any suggestions how to remove it. I m using aix 5.3
# 2  
Old 02-10-2010
The below code works without using "-C" option:

Code:
tar -cf /tmp/Test_shell/ZipTestFolder/archive10.tar /tmp/Test_shell/ZipTestFolder/*

# 3  
Old 02-10-2010
yes .. but i want to ignore directory references inside the tar and i am not aware of any other way of doing it.

I am running this command in WAS through java code so cannot do a cd to that directory for above purpose.
# 4  
Old 02-10-2010
Quote:

tar -cf /tmp/Test_shell/ZipTestFolder/archive10.tar -C /tmp/Test_shell/ZipTestFolder/ .

It creates one more folder no_name inside the tar file. any suggestions how to remove it. I m using aix 5.3
Next time, use code tags...
If what I see is really what you typed, then the possible cause is the space before the end dot (which may be misleading in AIX...)
Have you tried just:
Code:
tar -cf /tmp/Test_shell/ZipTestFolder/archive10.tar -C /tmp/Test_shell/ZipTestFolder/

?
# 5  
Old 02-10-2010
Yes i tried with -
Code:
tar -cf /tmp/Test_shell/archive10.tar -C /tmp/Test_shell/ZipTestFolder/

it runs without error but i dont see any tar file getting generated

Same happens when i do it with -

Code:
tar -cf /tmp/Test_shell/archive10.tar -C /tmp/Test_shell/ZipTestFolder/.

only when i put a space before the "." it works. but creates a folder inside it

Last edited by abhishek1.618; 02-10-2010 at 12:33 PM.. Reason: insert code tags
# 6  
Old 02-10-2010
I ment:

Code:
tar -cf /tmp/Test_shell/ZipTestFolder/archive10.tar -C /tmp/Test_shell/ZipTestFolder

(without slash at the end...)
# 7  
Old 02-10-2010
Same result ... runs without error but doesnt create a TAR

Now i have started getting this warning message too for past 2-3 attempts.

ksh: Cannot exceed the user or group quota
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Making Tar of directory and tar file is going to be placed

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)
Discussion started by: filosophizer
5 Replies

2. UNIX for Dummies Questions & Answers

How to tar a directory in AIX?

Hi i want to tar a directory.. i have tried few command but it is not working . please let me know how to tar and untar a directory below are the error which i am getting tar -zxvf tl11cp01_042414_071123.tar.gz tar: Not a recognized flag: z tar -zxvf... (3 Replies)
Discussion started by: scriptor
3 Replies

3. Shell Programming and Scripting

Tar of directory

i have a 10 directory in my path i have to take a tar of 7 directory without link files and also have to exclude those 3 directory. tar -cvzf /path/file_name.tar.gz directoryname please help!! facing problem in excluding links file (4 Replies)
Discussion started by: joy lobo
4 Replies

4. UNIX for Dummies Questions & Answers

How to Untar tar.gz to particular directory

Hi Guys, I am able to untar a tar.gz file. But it is again extracting the tar file to further child directory. I even tried the below command to untar it to particular directory. tar -zxvf gme_dly_sls_20120515035335.txt.tar.gz -C /sites/VSTAR/site/live/ftp/GMEUROPE I am getting the below... (4 Replies)
Discussion started by: mac4rfree
4 Replies

5. UNIX for Dummies Questions & Answers

tar files in directory

can someone give me a script to tar files that is older than 5 days in a directory that is not something like this: fileArray=($(find -mtime +5 asdfasdf)) tar -cvf asfadfasdfa ${fileArray} as the Unix I'm using has some problem with ($( )), I need another way to tar files in the folder.... (1 Reply)
Discussion started by: s3270226
1 Replies

6. UNIX for Advanced & Expert Users

How to rsync or tar directory trees, with hidden directory, but without files?

I want to backup all the directory tress, including hidden directories, without copying any files. find . -type d gives the perfect list. When I tried tar, it won't work for me because it tars all the files. find . -type d | xargs tar -cvf a.tar So i tried rsync. On my own test box, the... (4 Replies)
Discussion started by: fld2007
4 Replies

7. Shell Programming and Scripting

tar command dont tar to original directory

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)
Discussion started by: borderblaster
1 Replies

8. Shell Programming and Scripting

tar the entire directory except one directory

Hi All, I need to tar the entire directory except one directory inside that. I have used the below command tar -cvfX test.tar bin/perl bin/ I need to tar all the directories inside the bindirectory except the perl directory Please help me in solving this :b: Regards, Kalai (4 Replies)
Discussion started by: kalpeer
4 Replies

9. UNIX for Dummies Questions & Answers

Tar directory but exclude other

OS: SunOS perfs01 5.8 Generic_117350-23 sun4u sparc SUNW,UltraAX-i2 I want to tar a directory, but there are subdirectoires I want to exclude. Does anyone know how to do it? Please help. thanks. (1 Reply)
Discussion started by: leemjesse
1 Replies

10. UNIX for Dummies Questions & Answers

tar directory

Hello I try to tar a directory but I get this message # tar cvfb my directory prox.tar tar: invalid blocksize "prox.tar". What Im doing wrong. Solaris 5.6 And other question change this command with another version of solaris Thanks in advance (1 Reply)
Discussion started by: lo-lp-kl
1 Replies
Login or Register to Ask a Question