LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 04-13-2009, 06:59 PM   #1
thierry8p
LQ Newbie
 
Registered: Apr 2009
Posts: 6

Rep: Reputation: 0
Question Tar at lower compression density


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!
 
Old 04-13-2009, 08:16 PM   #2
John VV
Guru
 
Registered: Aug 2005
Posts: 13,456

Rep: Reputation: 1799Reputation: 1799Reputation: 1799Reputation: 1799Reputation: 1799Reputation: 1799Reputation: 1799Reputation: 1799Reputation: 1799Reputation: 1799Reputation: 1799
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)
 
Old 04-13-2009, 08:27 PM   #3
thierry8p
LQ Newbie
 
Registered: Apr 2009
Posts: 6

Original Poster
Rep: Reputation: 0
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!
 
Old 04-13-2009, 08:34 PM   #4
John VV
Guru
 
Registered: Aug 2005
Posts: 13,456

Rep: Reputation: 1799Reputation: 1799Reputation: 1799Reputation: 1799Reputation: 1799Reputation: 1799Reputation: 1799Reputation: 1799Reputation: 1799Reputation: 1799Reputation: 1799
then why did you state
Quote:
I'm looking to TAR at lower compression because
 
Old 04-13-2009, 08:42 PM   #5
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , Solaris 10, RHEL
Posts: 1,935
Blog Entries: 1

Rep: Reputation: 188Reputation: 188
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
 
Old 04-13-2009, 08:52 PM   #6
thierry8p
LQ Newbie
 
Registered: Apr 2009
Posts: 6

Original Poster
Rep: Reputation: 0
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. :-))
 
Old 04-13-2009, 09:22 PM   #7
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , Solaris 10, RHEL
Posts: 1,935
Blog Entries: 1

Rep: Reputation: 188Reputation: 188
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
 
Old 04-13-2009, 09:24 PM   #8
thierry8p
LQ Newbie
 
Registered: Apr 2009
Posts: 6

Original Poster
Rep: Reputation: 0
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!
 
Old 04-13-2009, 09:36 PM   #9
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , Solaris 10, RHEL
Posts: 1,935
Blog Entries: 1

Rep: Reputation: 188Reputation: 188
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/
 
  


Reply

Tags
compression, level, 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
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 carlosinfl 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 11:47 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration