LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Newbie
User Name
Password
Linux - Newbie This 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

Tags used in this thread
Popular LQ Tags , ,

Reply
 
Thread Tools
Old 04-13-2009, 06:59 PM   #1
thierry8p
LQ Newbie
 
Registered: Apr 2009
Posts: 4
Thanked: 0
Question Tar at lower compression density


[Log in to get rid of this advertisement]
hi,
I'm looking to TAR at lower compression because I'm trying to save time and load resources over disk space. I want to tar a big directory in ONE portable file. Maybe you have a better option to propose?


I read man tar and they specify density, but it does not work (or I don't understand how to use it).

man tar clearly state:
-[0-7][lmh] specify drive and density

I'm using tar (GNU tar) 1.15.1

Here are the commands I tried:
tar -c0 dir/destination.tar /dir/source/

root@server [~]# tar -c0 dir/destination.tar /dir/source/
tar: Options `-[0-7][lmh]' not supported by *this* tar

thanks for the help!
thierry8p is offline  
Tag This Post , ,
Reply With Quote
Old 04-13-2009, 08:16 PM   #2
John VV
Senior Member
 
Registered: Aug 2005
Location: Ann Arbor Mi.
Distribution: Arch Linux ,CentOS 5.4
Posts: 2,147
Thanked: 124
see http://en.wikipedia.org/wiki/Tar_(file_format)

a "tar" ball is uncompressed ( just blank spaces removed )
i think you want to use a .bz2 or tar.gz (.tgz) or for code use .7z ( it works in *nix)
John VV is offline     Reply With Quote
Old 04-13-2009, 08:27 PM   #3
thierry8p
LQ Newbie
 
Registered: Apr 2009
Posts: 4
Thanked: 0

Original Poster
Question

Currently, I am using rsync to make my local backup, which I LOVE, but the thing is that it stays a directory and not a file, hence it is managed by cpanel as disk space used by the user.

I want to exclude this content from the cpanel disk usage count by making it into a single file and chown it down to root:root.

But chown recursive will break my stuff upon restore.

So all I'm looking for is a wrapper to make my directory look like a single file... I have NO CARE for compression here.

This is why I am looking for the QUICKEST way to make a directory into a file.

thanks for your insight!
thierry8p is offline     Reply With Quote
Old 04-13-2009, 08:34 PM   #4
John VV
Senior Member
 
Registered: Aug 2005
Location: Ann Arbor Mi.
Distribution: Arch Linux ,CentOS 5.4
Posts: 2,147
Thanked: 124
then why did you state
Quote:
I'm looking to TAR at lower compression because
John VV is offline     Reply With Quote
Old 04-13-2009, 08:42 PM   #5
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora 11, CentOS 5.3, Linux Mint 5, Solaris 10
Posts: 1,260
Thanked: 35
Quote:
Originally Posted by thierry8p View Post
Currently, I am using rsync to make my local backup, which I LOVE, but the thing is that it stays a directory and not a file, hence it is managed by cpanel as disk space used by the user.

I want to exclude this content from the cpanel disk usage count by making it into a single file and chown it down to root:root.

But chown recursive will break my stuff upon restore.

So all I'm looking for is a wrapper to make my directory look like a single file... I have NO CARE for compression here.

This is why I am looking for the QUICKEST way to make a directory into a file.

thanks for your insight!
As stated before...Tar dosen't compress...

But on to your question...the "quickest" way to make a directory into a file is to tar it...but the directory will still exist along with the tar file...you can delete it if you with...

Code:
tar -cf dirname.tar dirname
custangro is offline     Reply With Quote
Old 04-13-2009, 08:52 PM   #6
thierry8p
LQ Newbie
 
Registered: Apr 2009
Posts: 4
Thanked: 0

Original Poster
great thanks!

so I'd love to drop rsync and tar directly then.
But can tar do like rsync? Meaning just update the file that changed?

thanks again!








ps:John; I wanted lower compression just to make things quicker - but no need now since it does not compress. :-))
thierry8p is offline     Reply With Quote
Old 04-13-2009, 09:22 PM   #7
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora 11, CentOS 5.3, Linux Mint 5, Solaris 10
Posts: 1,260
Thanked: 35
Quote:
Originally Posted by thierry8p View Post
great thanks!

so I'd love to drop rsync and tar directly then.
But can tar do like rsync? Meaning just update the file that changed?

thanks again!








ps:John; I wanted lower compression just to make things quicker - but no need now since it does not compress. :-))
Actually I've only done it using rsh (so I'm guessing that you can probably do it with rsync too...not sure though)

Example:
Code:
tar -cf - dirname | rsh hostname dd of=dirname.tar bs=20b
custangro is offline     Reply With Quote
Old 04-13-2009, 09:24 PM   #8
thierry8p
LQ Newbie
 
Registered: Apr 2009
Posts: 4
Thanked: 0

Original Poster
I created my tar file like this:
# tar -cjf /home2/backup_dir.tar /home/dir/

and now trying to update my tar file like this:
# tar -u /home2/backup_dir.tar /home/dir/

and I get this error:
# tar: Options `-Aru' are incompatible with `-f -'

any further help?
thanks again!
thierry8p is offline     Reply With Quote
Old 04-13-2009, 09:36 PM   #9
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora 11, CentOS 5.3, Linux Mint 5, Solaris 10
Posts: 1,260
Thanked: 35
Quote:
Originally Posted by thierry8p View Post
I created my tar file like this:
# tar -cjf /home2/backup_dir.tar /home/dir/

and now trying to update my tar file like this:
# tar -u /home2/backup_dir.tar /home/dir/

and I get this error:
# tar: Options `-Aru' are incompatible with `-f -'

any further help?
thanks again!
Hmmm...not familiar with the -u option...but just for S's and G's try this...

Code:
tar  -uf /home2/backup_dir.tar /home/dir/
custangro is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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
Tar compression, is this enough? blizunt7 Linux - Server 9 08-08-2007 10:45 AM
Configuring the density of a tar device kaplan71 Fedora 6 06-27-2007 12:20 PM
Tar Compression Carlwill Linux - Software 2 01-29-2007 11:34 AM
Curious about what tar, without compression, would be used for bdb4269 Linux - General 9 01-08-2007 07:36 PM
Does TAR use any compression? Micro420 Linux - General 15 12-13-2006 03:17 PM


All times are GMT -5. The time now is 01:18 PM.

Main Menu
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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration