Tar stucks while extracting


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Tar stucks while extracting
# 8  
Old 12-03-2014
It looks like it's trying to report an error.

What is the entire command used to run tar from inside the script?

What else does the script do?

Is the script run remotely, for example via ssh?

Is the script run by cron or at?
# 9  
Old 12-03-2014
A few more thoughts:-
  • Is there a particularly large file to extract somewhere within the file? It might be that it's running but giving no output for a while.
  • Is the process clocking CPU? Is there anything else running on the server? If not, have a look at the output of iostat 3 3 to see if there is activity.
Does that give you anything?


Robin
# 10  
Old 12-03-2014
You can trace it while running using tusc/truss/strace, properly optioned up for long and full output and the tar pid, to see what it is up to.
# 11  
Old 12-04-2014
The shell script runs remotely with aim is to extract tar content and remove the tar files from remote host machine

Code:
extract_scripts()
{
  cd $SCRIPT_PATH/scripts/
  su new -c "tar --no-overwrite-dir -hxzf $SCRIPTS_TAR_FILE"
  su new -c "gzip -fd script.tar.gz"
  su new -c "tar --no-overwrite-dir -hxf script.tar"
  if [ -f abs_path_file.tar.gz ]; then
    su new -c "mv abs_path_file.tar.gz /tmp"
    cd /
    su new -c "gzip -fd /tmp/abs_path_file.tar.gz"
    su new -c "tar --no-overwrite-dir -hxf /tmp/abs_path_file.tar"
  fi
  echo $?
}

This tar file size may vary, on host machine these script directories are created and then bundled in tar. FTP tar to remote host and later initiate extraction.

@Robin -This behavior (tar command stuck) is rare and I have observed CPU, server was not busy and once it happen again will provide the output (iostat 3 3)

Thanks all for help and advice will get back with details.
# 12  
Old 12-04-2014
As a "standard user" the script seems to be untarring from the root (/) directory. The paths contained in the tars are relative paths that start with logs/. So that would means a a regular user, the script is trying to create a directory /logs which I suspect may be failing?
# 13  
Old 12-04-2014
The script is ran from superuser and in order to extract tar files I change directory to target and then un-tar files.

Hence tar path will be created without any error
# 14  
Old 12-04-2014
OK, but in post #5 you said you were running the script as a "standard user". Which version is correct?
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Extracting .tar.gz files

I have a directory tree containing archive .tar.gz files that I want to extract at the location where they recide. How can I achieve such an operation? (7 Replies)
Discussion started by: kristinu
7 Replies

2. OS X (Apple)

Uncompressing but not extracting tar.Z file

Hi I have a few hundred files with extension .tar.Z. These files were archived (tar) and compressed (Z) on a UNIX system. I need to unzip them but not extract them. In other words they need to go to .tar extension. I would like to do this on my MAC or on a windows pc. I do not have a UNIX... (3 Replies)
Discussion started by: kalbano
3 Replies

3. UNIX for Advanced & Expert Users

Extracting directories only from tar ball

Hi Somebody must have done this before, but I can't seem to find any answer on my problem. On HP-UX 11i v3 I have a relatively large tar ball (~120 GB), and I want to create the directory structure only from the archive. There is no option to make a new archive with only the directory... (3 Replies)
Discussion started by: hpvm_adm
3 Replies

4. Shell Programming and Scripting

Extracting .tar files.

Hey guys complete n00b here so I'll try my best at explaining. I'm creating a backup and restore utility and decided to use tar. I create a backup folder in each user's account and when backing up (say word processing files), I use the following: tar cvf /home/user/backup/wpbackup.tar... (2 Replies)
Discussion started by: EwanD
2 Replies

5. Filesystems, Disks and Memory

Extracting certain /paths/* using tar

forgive my ignorance. I did a search of this sub-forum for "tar -xp" and variations on the same w\out success, so here goes... Scenario: filename.tar file. Desired Task: I want to be able to extract only files from the user's public_html folder (and all those under it as an option) from... (4 Replies)
Discussion started by: Habitual
4 Replies

6. UNIX for Dummies Questions & Answers

Extracting from a tar archive file

Can I extract files from an archive file (tar), where the filename includes the full directory path, to a different directory? For example the archive files may have a filename of /SrcFiles/XXX/filename.dat and I want to extract it to /SrcFiles/YYY/filename.dat. Since the archive file was... (1 Reply)
Discussion started by: nmalencia
1 Replies

7. UNIX Desktop Questions & Answers

Extracting from a tar file

Can I extract files from an archive file (tar), where the filename includes the full directory path, to a different directory? For example the archive files may have a filename of /SrcFiles/XXX/filename.dat and I want to extract it to /SrcFiles/YYY/filename.dat. Since the archive file... (1 Reply)
Discussion started by: nmalencia
1 Replies

8. UNIX for Dummies Questions & Answers

extracting from a tar file

Dear experts I have received a tar file containing several files with full path. Now I need to restore it in another system but when I want to extract files by using tar -xvf tarfile it wants to create all files with full paths again in new system in which I don't have enough previleges. How... (4 Replies)
Discussion started by: Reza Nazarian
4 Replies

9. UNIX for Advanced & Expert Users

extracting from tar.bz2

hi could any body tell me how to extract .tar.bz2 files i tried using tar but in vain. i found bzip2 in googling but i could not find it on machine unix tru64 please suggest. (1 Reply)
Discussion started by: Raom
1 Replies

10. UNIX for Dummies Questions & Answers

error while extracting using TAR

Hi folks, When I am extracting an archive using the: tar -xvf /dev/rmt0 command i get the following error: x ./GRBD8901/GRBR006T, 1763253368 bytes, 3443855 media blocks. tar: 0511-197 ./GRBD8901/GRBR006T: Cannot write data extracted with the tar command: ... (7 Replies)
Discussion started by: Erik Rooijmans
7 Replies
Login or Register to Ask a Question