LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-10-2003, 10:03 PM   #1
kbeaver
Member
 
Registered: Jul 2003
Location: Lakewood, CO
Distribution: SuSE 8.2
Posts: 41

Rep: Reputation: 15
tar a directory


Hello,
When I try to tar an entire directory (i.e. home/kbeaver/Backup) it tars fine, but it gives me an error.
home/kbeaver/Backup/: No such file or directory

Also, when I untar it, it creates a home directory that contains only a kbeaver directory which contains only a Backup directory which contains all of the files in Backup. Is there a way to remove the home and kbeaver directories?
 
Old 09-11-2003, 04:25 AM   #2
jalal
Member
 
Registered: Aug 2003
Location: .bh
Distribution: Gentoo
Posts: 188

Rep: Reputation: 30
yes, cd to /home/kbeaver and then tar the Backup directory.
 
Old 09-11-2003, 06:02 PM   #3
kbeaver
Member
 
Registered: Jul 2003
Location: Lakewood, CO
Distribution: SuSE 8.2
Posts: 41

Original Poster
Rep: Reputation: 15
Shell script

The problem is I am taring from a shell script. I can't change to my home. Is there anyway to get around that?
 
Old 09-12-2003, 12:29 AM   #4
mr_manny
Member
 
Registered: Sep 2003
Distribution: RH7.3, RH9 w/fluxbox best thing since sliced bread
Posts: 34

Rep: Reputation: 15
I think I don't completely understand the question?

If I cd to /tmp and perform a tar, I don't get the error you are experiencing:

cd /tmp

$ du -ks /home/jmcontre
492796 /home/jmcontre


tar cvf jmcontre.TAR /home/jmcontre

when the tar is done, I have a tar file:
[jmcontre@t230club tmp]$ ll jm*
-rw-rw-r-- 1 jmcontre jmcontre 484403200 Sep 11 22:29 jmcontre.TAR

my tar seems intact:

$ tar tvf jmcontre.TAR | more
drwx------ jmcontre/jmcontre 0 2003-09-11 22:10:17 home/jmcontre/
-rw-r--r-- jmcontre/jmcontre 24 2002-11-20 11:55:15 home/jmcontre/.bash_logout
-rw-r--r-- jmcontre/jmcontre 191 2002-11-20 11:55:15 home/jmcontre/.bash_profile
-rw-r--r-- jmcontre/jmcontre 486 2003-05-23 17:34:16 home/jmcontre/.bashrc
-rw-rw-r-- jmcontre/jmcontre 9280 2002-11-20 20:04:11 home/jmcontre/.gtkrc
-rw-r--r-- jmcontre/jmcontre 854 2002-11-20 11:55:15 home/jmcontre/.emac
etc.....


to my knowledge, you can cd to a directory and perform a tar within a script....just cd there prior to executing your tar cmd...


hope this helps,
manny
 
Old 09-12-2003, 11:00 AM   #5
fsbooks
Member
 
Registered: Jan 2002
Location: Missoula. Montana, USA
Distribution: Slackware (various)
Posts: 464

Rep: Reputation: 52
mr_manny is right. Post your script if you still have problems, OK?
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How Can I tar This Directory? Xian Linux - General 4 06-17-2005 06:32 PM
tar help - how to tar to a different directory thick_guy_9 Linux - Software 2 03-10-2005 04:35 PM
tar with directory path scatterbrain Linux - General 2 03-15-2004 11:05 PM
Can I tar a directory structure.... shelby Linux - General 9 02-20-2003 09:17 AM
tar a directory radnix Linux - General 5 09-08-2002 08:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:40 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