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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
04-13-2009, 05:59 PM
|
#1
|
|
LQ Newbie
Registered: Apr 2009
Posts: 6
Rep:
|
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!
|
|
|
|
04-13-2009, 07:16 PM
|
#2
|
|
Guru
Registered: Aug 2005
Posts: 9,692
|
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)
|
|
|
|
04-13-2009, 07:27 PM
|
#3
|
|
LQ Newbie
Registered: Apr 2009
Posts: 6
Original Poster
Rep:
|
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!
|
|
|
|
04-13-2009, 07:34 PM
|
#4
|
|
Guru
Registered: Aug 2005
Posts: 9,692
|
then why did you state
Quote:
|
I'm looking to TAR at lower compression because
|
|
|
|
|
04-13-2009, 07:42 PM
|
#5
|
|
Senior Member
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , Solaris 10, RHEL
Posts: 1,782
Rep: 
|
Quote:
Originally Posted by thierry8p
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
|
|
|
|
04-13-2009, 07:52 PM
|
#6
|
|
LQ Newbie
Registered: Apr 2009
Posts: 6
Original Poster
Rep:
|
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. :-))
|
|
|
|
04-13-2009, 08:22 PM
|
#7
|
|
Senior Member
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , Solaris 10, RHEL
Posts: 1,782
Rep: 
|
Quote:
Originally Posted by thierry8p
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
|
|
|
|
04-13-2009, 08:24 PM
|
#8
|
|
LQ Newbie
Registered: Apr 2009
Posts: 6
Original Poster
Rep:
|
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!
|
|
|
|
04-13-2009, 08:36 PM
|
#9
|
|
Senior Member
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , Solaris 10, RHEL
Posts: 1,782
Rep: 
|
Quote:
Originally Posted by thierry8p
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/
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 10:45 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|