LinuxQuestions.org
Visit Jeremy's Blog.
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 09-02-2006, 01:07 AM   #1
procfs
Member
 
Registered: Jan 2006
Location: Sri Lanka
Posts: 651

Rep: Reputation: 34
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
 
Old 09-02-2006, 03:00 AM   #2
routers
Member
 
Registered: Aug 2005
Location: Malaysia - KULMY / CNXTH
Distribution: Slackware, Fedora, FreeBSD, Sun O/S 5.10, CentOS
Posts: 787
Blog Entries: 6

Rep: Reputation: 75
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
 
Old 09-02-2006, 04:44 AM   #3
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
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.
 
Old 09-04-2006, 07:54 PM   #4
procfs
Member
 
Registered: Jan 2006
Location: Sri Lanka
Posts: 651

Original Poster
Rep: Reputation: 34
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
 
  


Reply

Tags
tar


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
Warning: time of day goes back (* us), taking countermeasures Jere P Linux - Networking 2 04-25-2006 05:14 AM
Directory Structure fedix Linux - Newbie 3 10-14-2005 02:48 PM
"WARNING: Circular directory structure" error when deleting directory pistonbrew Linux - Software 5 02-03-2005 06:05 AM
directory structure alaios Linux From Scratch 4 04-20-2004 06:16 PM
Can I tar a directory structure.... shelby Linux - General 9 02-20-2003 09:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:00 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
Open Source Consulting | Domain Registration