Creating a tarball on Solaris issue with errors


 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Creating a tarball on Solaris issue with errors
# 1  
Old 03-18-2019
Creating a tarball on Solaris issue with errors

Hi All,
We are planning to migrate from Solaris to AIX, and we have a requirement to move all files modified in last 7 days to AIX.

i found many helpful forums on this site but somehow the issue was still not solved:

Used the following command from the directory which we want to scan
Code:
find "$PWD" -type f -mtime -4 2>/dev/null | xargs /usr/sfw/bin/gtar -Pcvf - | gzip -c > /folder1/folder2/folder3/file_clink.tar.gz

I could not use tar as it has restrictions on file size and was giving error:
Tar too large to archive. Use E function modifier

Now the issue coming is i am getting following error as files keep on modifying:
/usr/sfw/bin/gtar: Exiting with failure status due to previous errors
I want to ignore these and let the tar ball be created.

Final tar ball created skips all files above these errors when i check the contents of final file.

Since this is a one time task so we are not bothered much even if it takes little extra time. We can also avoid zip in case that solves the issue, but i tried and got same result

Thanks for your help
# 2  
Old 03-18-2019
Maybe just keep it simple and write the output of your find command to a file first.

Then after you have a flat file of all the files you want to tar, read the file ( or parts of it ) and do the tar process next.

Then after you have a nice tar file ( or multiple tar files ) then zip it up.

Sometimes "simple" is faster and easier.
# 3  
Old 03-18-2019
A comment. The errors mean you will not get all files over to AIX. So ignoring errors is not a viable strategy. There are other options.
Consider scp which does not have file size limits, for example, run in parallel
Code:
#!/bin/bash
# run 20 file copy streams at one time, in parallel
# good approach for larger files
cnt=0
find /path/to/files -type f |
while read fname do
    scp $fname  username@server_ip:/path_to_remote_directory
   cnt=$((  $cnt + 1  ))
   if [  $((  $cnt % 20   )) -eq 0 ] ; then
      wait
  fi
done

This User Gave Thanks to jim mcnamara For This Post:
# 4  
Old 03-18-2019
I guess will have to work with a text file as NEO mentioned as the files are there in multiple directories so path to remote directory is not fixed
# 5  
Old 03-18-2019
You could also try using pax -x pax to create the archive on Solaris and read the archive on AIX. The pax pax format is an extended tar format that uses additional header records to get around the header fields in the normal tar headers that limit file sizes.

Note that this post originally said the extended headers were available in the ustar format; that was not correct (although some implementations now accept pax format header extensions when reading ustar format archives).

Last edited by Don Cragun; 03-18-2019 at 09:36 PM..
These 3 Users Gave Thanks to Don Cragun For This Post:
# 6  
Old 03-18-2019
The pax available on hp-ux uses ustar format by default, the extended interchange format with support for files > 2GB ("largefiles"). So there is no problem on the receiving end.
pax example usage: How to use pax - Wiki-UX.info
These 2 Users Gave Thanks to jim mcnamara For This Post:
# 7  
Old 03-19-2019
Thanks all for your support. I created the tar using pax command and have shared the tarball with our system admin to uncompress it on the new server.
Contents and count of files look good.
This User Gave Thanks to nikhil8 For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Issue while creating RPM

I am trying to create an RPM that basically creates a JBOss container. At the end it copies folders and files in a particular directory structure. /root/rpmbuild/SOURCES # tree cac-1.0 cac-1.0 └── opt └── msdp └── ca └── iam_cac ... (1 Reply)
Discussion started by: Junaid Subhani
1 Replies

2. Shell Programming and Scripting

Self extracting tarball

I was wondering if anyone can point me to some topics, material, or tutorials that can help me write a shell script that creates a second script that is a Self-extracting tarball. Don't want any actual code obviously because this is a school project, but I feel my teacher didn't well cover the... (3 Replies)
Discussion started by: canes27
3 Replies

3. Shell Programming and Scripting

Extract compressed tarball to folder?

This is for Red Hat Enterprise Linux Client release 5.7 (Tikanga). Wanna extract entire contents of a tar.gz to a folder of my choosing. Thanks (2 Replies)
Discussion started by: stevensw
2 Replies

4. Shell Programming and Scripting

Creating subset of compilation errors

I am compiling a fortran program using gfortran and the result looks as below I want to write a bash or awk script that will scan the information and output only problems within a range of line numbers Example: If I specify the file createmodl.f08, start line 1000 and end line 1100, I will... (8 Replies)
Discussion started by: kristinu
8 Replies

5. Solaris

apache 2.2.22 Solaris errors

Hi, I have installed apache 2.2.22 on solaris machine and trying to do some basic testing, but it is failing for one of the scenario. Seeing below in the error logs But noy sure why there is a need for AuthUserFile when i mentioned AuthldapURL. Please advise Thanks (1 Reply)
Discussion started by: prash358
1 Replies

6. Shell Programming and Scripting

tarball of current directory

I wanna make a backup tarball. I wanna write a script that makes tarball of the current directory. There are lots of files so I cant type all files, I wanna make the tarball by excluding few files. Like there 1000 files in a directory I wanna create a tarball containing 98 files of that... (1 Reply)
Discussion started by: nishrestha
1 Replies

7. Shell Programming and Scripting

Unpack individual files from tarball

Say you don't want to unpack the whole thing, just individual files or directories within a .tgz. How to do this? (1 Reply)
Discussion started by: stevensw
1 Replies

8. UNIX for Dummies Questions & Answers

Is there any way to add to a tarball made in this fashion

Hello, I am wondering if there is an easy way to add a file to a tarball rather than extracting, adding, then remaking the tarball. The tarball was made in this way: tar -cpvzf .wine.tar.gz .wine/If I had a file to the .wine/ dir (or if I just wanted to add a file to the tarball), I would... (4 Replies)
Discussion started by: Narnie
4 Replies

9. Solaris

Solaris Zone errors

after booting up my zone i get following error # zlogin -C DB_zone Sep 29 09:18:46 svc.startd: Could not log for svc:/system/filesystem/root:default: write(51) failed with I/O error. Sep 29 09:18:47 svc.startd: Could not log for svc:/system/installupdates:default: write(17) failed with... (5 Replies)
Discussion started by: fugitive
5 Replies

10. Solaris

Solaris 9 lroundf errors

When I want to install some softwares from source with gcc/4.3 on a sparc solaris 9 I always have errors like this one : (example with lapack-3.2) ../../lapack_SUN4.a(slacn2.o): In function `slacn2_': slacn2.f:(.text+0x1b0): undefined reference to `lroundf' slacn2.f:(.text+0x370): undefined... (0 Replies)
Discussion started by: wolfhurt
0 Replies
Login or Register to Ask a Question