tar error
dear gurus i am facing tar error i try many ways but always fail i copy some file/folder from windows pc to linux and wish to make .tar.gz file
however other location folders it is working fine [root@test7 ]# tar -cvf /test/backup_app/test_app.tar.gz tar: Cowardly refusing to create an empty archive Try `tar --help' or `tar --usage' for more information [root@test7 ]# tar cvzf /test/backup_app/test_app.tar.gz tar: Cowardly refusing to create an empty archive Try `tar --help' or `tar --usage' for more information [root@test7 ]# tar -cvzf /test/backup_app/test_app.tar.gz tar: Cowardly refusing to create an empty archive Try `tar --help' or `tar --usage' for more information regards |
You didn't tell tar what to archive:
Code:
tar cvzf /test/backup_app/test_app.tar.gz /directory/to/tar Code:
tar cvzf /test/backup_app/test_app.tar.gz . |
Hi,
@salimshahzad: The command given is not correct. You need to tell tar the name of the archive (which you did) and what to tar (which you did not). tar cvf name.of.archive.tar /target/to/tar or tar cvf name.of.archive.tar file1 file2 Take a look here: tar manual: 2.6 How to Create Archives Hope this helps. |
dear gurus thanks for support i miss next line
suggest how to do full compress or max compress in linux rgds |
Hi,
Tar (the basics) just creates an archive, it does not compress anything. Depending on your version of tar you can go 2 ways to compress your data: 1) first use a compressing tool (like bzip2, zip, etc), then tar all the comressed files. 2) use tar's build in compression options (this needs to be present in your tar version. it probably is). An example of the second option: tar cvz name.tar file <- uses gzip to compress. tar cvj name.tar file <- uses bzip2 to compress. tar cvZ name.tar file <- uses compress to compress. Take a look here as well: 8.1 Using Less Space through Compression Hope this helps. |
dear gurus thanks so nice quick repsonse
some people do .tar.gz file does it means it is compress by default, as i heard there r 7-9 level of compression to use in tar/gz combination your option tar cvZ name.tar file <- uses compress to compress. does it compress fully max. 1 more query 2 clarify, how to do full or max compression level use in linux for any directory or files. kind regards again salim |
Hi,
The name a tarfile gets is all up to the user and doesn't necessarily say anything about the way the archive was created/compressed. Logic says (but keep my previous comment in mind) that a file ending with: .tar -> archived with tar (no compression) .tar.gz or .tgz -> compressed by gzip and archived by tar (the compression part can be done by tar's -z option or gzip itslef). .tar.bz -> compressed with bzip2, archived by tar. I don't think tar can handle the extra compression that some of the tools (gzip. bzip2 etc) have. I haven't seen options for it. If extra compression is needed take a look at, for example, gzip's options to do so (gzip -# <1-9> <file> or gzip -best <file>). This also means that you need to gzip the file(s) first and then use tar to archive the lot. bzip2 also has an option for extra compression: bzip2 -1 <file> -> bzip2 -9 <file> 1 being fast and less compression, 9 being slow and best compression. Hope this helps. |
Quote:
|
Hi,
Quote:
Quote:
|
Quote:
|
All times are GMT -5. The time now is 04:36 AM. |