command line compression?
- Red Squirrel
- Posts: 29209
- Joined: Wed Dec 18, 2002 12:14 am
- Location: Northern Ontario
- Contact:
command line compression?
Is it possible to compress files (ex: make a folder a black hole archive) via command line? If yes how do I do it, and how do I extract it? My server drive is getting nearly full so I want to start archiving stuff. I'm hoping to be able to make black hole archives as they are 50% the original size which beats mostly all other compression methods but if that's not possible then anything will do.
Archived topic from Anythingforums, old topic ID:495, old post ID:4360
Archived topic from Anythingforums, old topic ID:495, old post ID:4360
Honk if you love Jesus, text if you want to meet Him!
command line compression?
man tarRed Squirrel wrote: Is it possible to compress files (ex: make a folder a black hole archive) via command line? If yes how do I do it, and how do I extract it? My server drive is getting nearly full so I want to start archiving stuff. I'm hoping to be able to make black hole archives as they are 50% the original size which beats mostly all other compression methods but if that's not possible then anything will do.
Archived topic from Anythingforums, old topic ID:495, old post ID:4365
Resistance is futile...
Registered Linux User #321628
Anime/Toon Avatars
Other Cool Forums
"Never hold your farts in. They travel up your spine, into your brain, and that's where you get s**tty ideas from..." - Woyaya - January 10, 2004
command line compression?
a black hole???
+1 on the "man tar"
im sure well get questions on how to use it though, which is fine.
Archived topic from Anythingforums, old topic ID:495, old post ID:4374
+1 on the "man tar"
im sure well get questions on how to use it though, which is fine.
Archived topic from Anythingforums, old topic ID:495, old post ID:4374
- Red Squirrel
- Posts: 29209
- Joined: Wed Dec 18, 2002 12:14 am
- Location: Northern Ontario
- Contact:
command line compression?
After second try I got it working but there's like hardly any compression on tars, so is there a different way? Black holes are incredible archives, you can get some folders down to like 10% the original size, depending on what's in it. Usually it's 50% but the few last folders I did locally I turned 1GB of data to like 50 megs lol... all logs and easy to compress files.
Archived topic from Anythingforums, old topic ID:495, old post ID:4377
Archived topic from Anythingforums, old topic ID:495, old post ID:4377
Honk if you love Jesus, text if you want to meet Him!
command line compression?
use the -j or -z options with tar. -j will use the bzip compression and -z will use the gzip compression.
Archived topic from Anythingforums, old topic ID:495, old post ID:4397
Archived topic from Anythingforums, old topic ID:495, old post ID:4397
Resistance is futile...
Registered Linux User #321628
Anime/Toon Avatars
Other Cool Forums
"Never hold your farts in. They travel up your spine, into your brain, and that's where you get s**tty ideas from..." - Woyaya - January 10, 2004
command line compression?
does going from 71.3 MB down to 28.2 MB count as a black hole?
that's using the gzip compression on my home directory.
Archived topic from Anythingforums, old topic ID:495, old post ID:4398
that's using the gzip compression on my home directory.
Archived topic from Anythingforums, old topic ID:495, old post ID:4398
Resistance is futile...
Registered Linux User #321628
Anime/Toon Avatars
Other Cool Forums
"Never hold your farts in. They travel up your spine, into your brain, and that's where you get s**tty ideas from..." - Woyaya - January 10, 2004
- Red Squirrel
- Posts: 29209
- Joined: Wed Dec 18, 2002 12:14 am
- Location: Northern Ontario
- Contact:
command line compression?
Well that's pretty good I'll go with that then.
How to I fix this error though?
[root@localhost day_backup]# tar -cfz local.tar local.old
tar: local.tar: Cannot stat: No such file or directory
tar: Error exit delayed from previous errors
[root@localhost day_backup]#
Archived topic from Anythingforums, old topic ID:495, old post ID:4399
How to I fix this error though?
[root@localhost day_backup]# tar -cfz local.tar local.old
tar: local.tar: Cannot stat: No such file or directory
tar: Error exit delayed from previous errors
[root@localhost day_backup]#
Archived topic from Anythingforums, old topic ID:495, old post ID:4399
Honk if you love Jesus, text if you want to meet Him!
command line compression?
the command structure matters when using tar.
tar -cvzf name_of_archive.tar.gz directory_or_files
because the z came in front of the f, you need to put the name of the tarball first before the source directory. it could also be an error in the naming convention in that you gave the -z option so it was expecting the output file to have a *.tar.gz extension.
Archived topic from Anythingforums, old topic ID:495, old post ID:4400
tar -cvzf name_of_archive.tar.gz directory_or_files
because the z came in front of the f, you need to put the name of the tarball first before the source directory. it could also be an error in the naming convention in that you gave the -z option so it was expecting the output file to have a *.tar.gz extension.
Archived topic from Anythingforums, old topic ID:495, old post ID:4400
Resistance is futile...
Registered Linux User #321628
Anime/Toon Avatars
Other Cool Forums
"Never hold your farts in. They travel up your spine, into your brain, and that's where you get s**tty ideas from..." - Woyaya - January 10, 2004
- Red Squirrel
- Posts: 29209
- Joined: Wed Dec 18, 2002 12:14 am
- Location: Northern Ontario
- Contact:
command line compression?
Thanks that worked... but I only got it down to 54MB and the folder was 64MB is that normal?
Archived topic from Anythingforums, old topic ID:495, old post ID:4405
Archived topic from Anythingforums, old topic ID:495, old post ID:4405
Honk if you love Jesus, text if you want to meet Him!
command line compression?
depends. i think gzip does really good on text files. if you got a lot of binaries, the compression might not be so good. if you want you can seperate out the commands. like do a tar first with no -z option and then use the gzip command.
man gzip
to get the options of gzip.
or you could try it with the -j option and try the bzip compression. iiirc, bzip should do better compression.
man bzip2
Archived topic from Anythingforums, old topic ID:495, old post ID:4406
man gzip
to get the options of gzip.
or you could try it with the -j option and try the bzip compression. iiirc, bzip should do better compression.
man bzip2
Archived topic from Anythingforums, old topic ID:495, old post ID:4406
Resistance is futile...
Registered Linux User #321628
Anime/Toon Avatars
Other Cool Forums
"Never hold your farts in. They travel up your spine, into your brain, and that's where you get s**tty ideas from..." - Woyaya - January 10, 2004
- Red Squirrel
- Posts: 29209
- Joined: Wed Dec 18, 2002 12:14 am
- Location: Northern Ontario
- Contact:
command line compression?
It's mostly text file (html and php) there's some binaries such as pictures but most of it is html. I'll try it with other folders though and see what I get. If not I can just set my samba permissions to write and do it with power archiver. gzip is way faster then black hole at compressing though. If I want to black hole my whole backup folder It's something I'd leave on overnight.
Archived topic from Anythingforums, old topic ID:495, old post ID:4407
Archived topic from Anythingforums, old topic ID:495, old post ID:4407
Honk if you love Jesus, text if you want to meet Him!
command line compression?
Tar just makes an archive of the files with no compression. You need to add the -z for gzip compression which is really good. If you use -j in stead of -z you are using the bzip which is even better compression.
I think geekhaven had an article on this.
Archived topic from Anythingforums, old topic ID:495, old post ID:4464
I think geekhaven had an article on this.
Archived topic from Anythingforums, old topic ID:495, old post ID:4464
- Red Squirrel
- Posts: 29209
- Joined: Wed Dec 18, 2002 12:14 am
- Location: Northern Ontario
- Contact:
command line compression?
Yeah while gzip and tar are good, they don't compete with black hole. But it's ok, since it's good to know there's the tar command since I can use this to make quick archives. I have a 30GB folder on my server and I ain't black holing that over the network. So I'll gzip that one, much faster.
Archived topic from Anythingforums, old topic ID:495, old post ID:4465
Archived topic from Anythingforums, old topic ID:495, old post ID:4465
Honk if you love Jesus, text if you want to meet Him!
- Red Squirrel
- Posts: 29209
- Joined: Wed Dec 18, 2002 12:14 am
- Location: Northern Ontario
- Contact:
command line compression?
Hmm I just noticed I have backups of backups of backups at some places. while compression is good, nothing beats deletation, when you want to save space.
Archived topic from Anythingforums, old topic ID:495, old post ID:4466
Archived topic from Anythingforums, old topic ID:495, old post ID:4466
Honk if you love Jesus, text if you want to meet Him!
- Red Squirrel
- Posts: 29209
- Joined: Wed Dec 18, 2002 12:14 am
- Location: Northern Ontario
- Contact:
command line compression?
hahaha I have an archive going and it's been like 2 hours. It's a huge folder with tons of files of different type and sizes.
Archived topic from Anythingforums, old topic ID:495, old post ID:4469
Archived topic from Anythingforums, old topic ID:495, old post ID:4469
Honk if you love Jesus, text if you want to meet Him!