LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-28-2016, 11:43 AM   #1
fanoflq
Member
 
Registered: Nov 2015
Posts: 397

Rep: Reputation: Disabled
tar : Unable to zip all files


Here is what I did;

Code:
user1@host ~ $ ls -al *.gz
ls: cannot access *.gz: No such file or directory

user1@host ~ $ tar -C /usr -zcf include.tar.gz include; cd

user1@host ~ $ ls -al *.gz
-rw-r--r--. 1 user1 user1 3596247 Jul 28 10:18 include.tar.gz

user1@host ~ $ ls -al restore
total 8
drwxr-xr-x.   2 user1 user1 4096 Jul 28 10:15 .
drwxr-xr-x. 122 user1 user1 4096 Jul 28 10:18 ..

user1@host ~ $ cd restore; tar -xf ~/include.tar.gz ; cd 

user1@host ~ $ ls -al restore
total 12
drwxr-xr-x.   3 user1 user1 4096 Jul 28 10:20 .
drwxr-xr-x. 122 user1 user1 4096 Jul 28 10:18 ..
drwxr-xr-x.  43 user1 user1 4096 Jun 20 13:51 include

# Looks for missing files
user1@host ~ $ diff -qr ~/restore/include /usr/include
diff: /home/user1/restore/include/numpy: No such file or directory
diff: /home/user1/restore/include/python2.7/numpy: No such file or directory

# FOUND 2 MISSING FILES  OR DIRECTORY FROM RESTORED FOLDER!  why?

user1@host ~ $ ls /usr/include/numpy
arrayobject.h       ndarrayobject.h               npy_3kcompat.h   npy_math.h               old_defines.h  utils.h
arrayscalars.h      ndarraytypes.h                npy_common.h     npy_no_deprecated_api.h  oldnumeric.h
halffloat.h         _neighborhood_iterator_imp.h  npy_cpu.h        npy_os.h                 __ufunc_api.h
__multiarray_api.h  noprefix.h                    npy_endian.h     _numpyconfig.h           ufunc_api.txt
multiarray_api.txt  npy_1_7_deprecated_api.h      npy_interrupt.h  numpyconfig.h            ufuncobject.h

user1@host ~ $ cd  /home/user1/restore/include/numpy
bash: cd: /home/user1/restore/include/numpy: No such file or directory

user1@host ~ $ tar -tvf include.tar.gz | grep numpy
lrwxrwxrwx root/root         0 2015-05-29 20:35 include/python2.7/numpy -> ../../lib/python2.7/dist-packages/numpy/core/include/numpy
lrwxrwxrwx root/root         0 2015-05-29 20:35 include/numpy -> ../lib/python2.7/dist-packages/numpy/core/include/numpy
And the missing files are in the tar file:
Code:
user1@host ~ $ tar -tvf include.tar.gz | grep "include/numpy"
lrwxrwxrwx root/root         0 2015-05-29 20:35 include/python2.7/numpy -> ../../lib/python2.7/dist-packages/numpy/core/include/numpy
lrwxrwxrwx root/root         0 2015-05-29 20:35 include/numpy -> ../lib/python2.7/dist-packages/numpy/core/include/numpy

user1@host ~ $ tar -tvf include.tar.gz | grep "include/python2.7/numpy"
lrwxrwxrwx root/root         0 2015-05-29 20:35 include/python2.7/numpy -> ../../lib/python2.7/dist-packages/numpy/core/include/numpy
Why are those files missing in the extracted restore folder?
Thank you.

Last edited by fanoflq; 07-28-2016 at 11:47 AM.
 
Old 07-28-2016, 12:11 PM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 3,437

Rep: Reputation: 1507Reputation: 1507Reputation: 1507Reputation: 1507Reputation: 1507Reputation: 1507Reputation: 1507Reputation: 1507Reputation: 1507Reputation: 1507Reputation: 1507
Those missing "files" are actually symlinks to files outside of the directory tree you included in the archive. You would need to include the "-h" (--dereference) option to make tar archive actual files instead of the links.
 
1 members found this post helpful.
Old 07-28-2016, 12:21 PM   #3
fanoflq
Member
 
Registered: Nov 2015
Posts: 397

Original Poster
Rep: Reputation: Disabled
Thank you.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to archive (tar,zip..) only files with execute bit? postcd Linux - General 1 04-09-2016 09:34 AM
How to Tar/Zip files do a different directory from compression AK139 Linux - Newbie 14 08-16-2013 12:35 AM
Problem sending .tar files, turns into a .zip?Why? Ank_with problems Linux - Newbie 3 07-01-2009 03:12 AM
Help!! how to password protect tar and zip files pnmanojshenoy Linux - Newbie 3 07-08-2008 01:18 AM
Tar/Zip Files and Such Godboo Linux - Newbie 2 01-10-2004 04:33 PM


All times are GMT -5. The time now is 05:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration