tar says: cannot create


 
Thread Tools Search this Thread
Operating Systems HP-UX tar says: cannot create
# 1  
Old 01-08-2008
tar says: cannot create

Hello, I'm quite new to HP-UX and I stumbeled upon some strange behaviour from tar.

I have a script like this:
find -mtime $days -type f|xargs tar cvf tarfile.tar

and it make me a tar file with files that has been changed in $days.
When i run 'tar tf tarfile.tar' it give me output like this:
File1
dir1/dir2/File2
dir1/dir2/File3
...

But when i try 'tar xf tarfile.tar' I get:
tar: File1 - cannot create
tar: dir1/dir2/File2 - cannot create
tar: dir1/dir2/File3 - cannot create
...

I have tried this with GNU tar on same machine, and then it work (same user, same file and destination). The same on Solaris. I'm not sure what version of tar this is but the HP-UX is 11i version 1.

I hope someone can help me with this one Smilie

best regards.
# 2  
Old 01-10-2008
there is nothing special in hp-ux tar. this message will come if file/directory creat permission is not there.
# 3  
Old 01-10-2008
Different versions of tar handle a tarball taken from the root filesystem (/) differently. One will restore to the current working directory, an other will restore back to / (and would produce the error you see).

Could that be happening here?

Edit: It's also unusual to call find with no directory to serach over. I'd suggest putting a '.' between find and -mtime...
# 4  
Old 01-11-2008
Thank you for your answers and time Smilie

Smiling dragon: sorry, that was just a typo. I have a var stating the directory find shall search through.

And regarding file perms in the mentioned directories, they are ok. I'm able to use gnu tar with same file, same user and same directory.

But to whereas hp-ux tar have some issues with directories, I have tried various approaches.

1. in the example in my original post I've stripped away leading ./ that "find ..|xargs ..." made in the tarball. This does not work.

2. I've tried with leading ./ in tarball, does not work.

3. Absolute paths is out of question, but work :/

I'll be looking into this some more, and I hope we'll find a solution for this. (Other than using GNU tar Smilie )

Best regards.
# 5  
Old 01-11-2008
Well, I notice that the man page says to use the o function modifier key when this happens. Maybe you should try that.
# 6  
Old 01-11-2008
I saw that too, but I could not get tar to behave any better.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Create Tar ball

Hi Team, Following unix command is throwing error. Can anyone please help me to fix the issue? tar -cvf /aa/bb/cc/tarball1.tar /x/y/z1/abc.ksh /x/y/z2/pqr.txt /x/y/z3/lmn.tmp Error message thrown: tar: Removing leading `/' from member names OS: uname -a Linux xyz... (1 Reply)
Discussion started by: kmanivan82
1 Replies

2. UNIX for Dummies Questions & Answers

Create an incremental tar

Hello, I need to create a tar file with a list of files from a directory. The directory has about 1000+ files of which I only need to create a tar ball of 150 files. The 150 files I need in the tar ball do not have common names or a common start letter. No two file names match, example: 1st... (3 Replies)
Discussion started by: babyPen1985
3 Replies

3. UNIX for Dummies Questions & Answers

Create Tar files

Hi, the folder /home/nandy/test will have two files called notepad1 nodepad2 when i issued /home/nandy/test> tar -cvf componse.tar ./notepad1 ./notepad2 and no error /home/nandy/test> tar -cvf nan.tar . --> this creates nan.tar with the below message nan.tar same... (1 Reply)
Discussion started by: Nandy
1 Replies

4. Shell Programming and Scripting

Create tar file

Following are the list of files available in the dataout directory a1.txt.gz a2.txt.gz b3.txt.gzStep 1: now the tar file needs to be created as follows. tar -cvf ab.tar *.gzAll the files with extn .gzg has to be bundled in the tar file. Once the tar file is created, the files which are... (9 Replies)
Discussion started by: kmanivan82
9 Replies

5. UNIX for Advanced & Expert Users

Create corrupted *.tar.gz file ?

Hello. I`m writing a bash script who archive log files and send them to backup server. I need some kind of checking mechanism for *.tar.gz files. I found something like: gunzip -t file.tar.gz //Not output from it. And for tar: tar tf file.tar.gz //Only lists archive 1.) I need make a... (3 Replies)
Discussion started by: jabalv
3 Replies

6. UNIX for Dummies Questions & Answers

How to create rpm from tar.gz?

I m planning to use puppet to implement organizational linux hardening policies across the linux servers. To begin with i have downloaded. puppet-2.7.1.tar.gz and tried some basic configuration to get start with puppet. Now i want to roll out the puppet but before that i would like to make... (7 Replies)
Discussion started by: pinga123
7 Replies

7. UNIX for Advanced & Expert Users

How to create a Tar of multiple Files in Unix and FTP the tar to Windows.

Hi, On my Unix Server in my directory, I have 70 files distributed in the following directories (which have several other files too). These files include C Source Files, Shell Script Source Files, Binary Files, Object Files. a) /usr/users/oracle/bin b) /usr/users/oracle... (1 Reply)
Discussion started by: marconi
1 Replies

8. Linux

tar usage and delete/create username

dear Linux expert, I am using Fedora R5 how to use tar to archive /var to a test_var.tar and compressing it? how to delete a user? just remove the line in /etc/passwd? and then what is the procedure to create a new user ? many thank (2 Replies)
Discussion started by: zp523444
2 Replies

9. UNIX for Dummies Questions & Answers

Create and pw protect .tar files

Ok here at work I have been charged with finding a way to create a password protect .tar files from the command line. Now i have yet to actully sit down and learn UNIX yet, but that is one of my next todo's. Anyway my questions is I have been surfing in search of a solution and the closest answer... (5 Replies)
Discussion started by: clovell
5 Replies

10. UNIX for Dummies Questions & Answers

script to create tar file

hello, im a newbie in unix scripting. can someone pls send me a sample script that will tar files in the folders of a specific directory, but will exclude specific files, and afterwards, will ftp the tar into another server. for example: in this directory, pshrprod:/opt/psoft/weblogic/818sp9_80... (2 Replies)
Discussion started by: ajrandrup
2 Replies
Login or Register to Ask a Question