LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Tar at lower compression density (https://www.linuxquestions.org/questions/linux-newbie-8/tar-at-lower-compression-density-718877/)

thierry8p 04-13-2009 05:59 PM

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!

John VV 04-13-2009 07:16 PM

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)

thierry8p 04-13-2009 07:27 PM

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!

John VV 04-13-2009 07:34 PM

then why did you state
Quote:

I'm looking to TAR at lower compression because

custangro 04-13-2009 07:42 PM

Quote:

Originally Posted by thierry8p (Post 3507903)
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

thierry8p 04-13-2009 07:52 PM

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. :-))

custangro 04-13-2009 08:22 PM

Quote:

Originally Posted by thierry8p (Post 3507917)
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

thierry8p 04-13-2009 08:24 PM

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!

custangro 04-13-2009 08:36 PM

Quote:

Originally Posted by thierry8p (Post 3507929)
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/


All times are GMT -5. The time now is 08:02 AM.