LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   taking tar back up of only the directory structure (https://www.linuxquestions.org/questions/linux-newbie-8/taking-tar-back-up-of-only-the-directory-structure-479656/)

procfs 09-02-2006 01:07 AM

taking tar back up of only the directory structure
 
Hi
can any bod tell me how to taking a tar back up of only the directory structure

Regards

Asanka

routers 09-02-2006 03:00 AM

do you mean you already compress several directory together then you want to uncompress just one directory from what you already backup ?

if yes do this way

to view what inside your backup add the "t"
---------------------------view only-----------------
[rou@nc temp]$ ls
liquid-0.9.7.tar.bz2
[rou@nc temp]$ tar tfvj liquid-0.9.7.tar.bz2
drwxr-xr-x sarath/users 0 2004-07-09 02:55:10 liquid-0.9.7/
drwxr-xr-x sarath/users 0 2004-07-09 02:49:57 liquid-0.9.7/po/
-rw-r--r-- sarath/users 15 2004-07-07 02:59:24 liquid-0.9.7/po/Makefile.am
-rw-r--r-- sarath/users 0 2004-07-07 02:59:24 liquid-0.9.7/TODO
-rw-r--r-- sarath/users 2565 2004-07-07 02:59:24 liquid-0.9.7/liquid.kdevelop
drwxr-xr-x sarath/users 0 2004-07-07 02:59:24 liquid-0.9.7/admin/
drwxr-xr-x sarath/users 0 2004-07-07 02:59:24 liquid-0.9.7/admin/CVS/
-rw-r--r-- sarath/users 18 2004-07-07 02:59:24 liquid-0.9.7/admin/CVS/Tag
-rw-r--r-- sarath/users 45 2004-07-07 02:59:24 liquid-0.9.7/admin/CVS/Root
.........
............

----------------end------------

------extract folder you need eg. admin--------------

[rou@nc temp]$ tar xfvj liquid-0.9.7.tar.bz2 liquid-0.9.7/admin/
liquid-0.9.7/admin/
liquid-0.9.7/admin/CVS/
liquid-0.9.7/admin/CVS/Tag
liquid-0.9.7/admin/CVS/Root
liquid-0.9.7/admin/CVS/Repository
....
.....
-----------------end------------------------
------------result------------
[rou@nc temp]$ ls
liquid-0.9.7 liquid-0.9.7.tar.bz2
[rou@nc temp]$ ls liquid-0.9.7
admin
[rou@nc temp]$

----------------

cheers

druuna 09-02-2006 04:44 AM

Hi,

If you want to tar a directory structure without the actual files:

tar cf dirstructure.tar --no-recursion --files-from <( find . -type)

Hope this helps.

procfs 09-04-2006 07:54 PM

Hay Thank you guys

touters what druuna says is what I want just to take the empty directory structure in to a tar back up

Thanks guys

Regards

Asanka


All times are GMT -5. The time now is 03:22 AM.