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 10-11-2004, 10:56 AM   #1
glenn69
Member
 
Registered: Jul 2003
Location: Chicagoland
Distribution: ArchLinux
Posts: 261

Rep: Reputation: 32
Question gzip , general compression question ??


I am using gzip to compress a daily backup. When I gzip a file, the file is changed to a .gz file. I would rather not compress the file itself every day. Instead I would like to create a NEW file that is a compressed version of the original (much like winzip does...it makes a new zip file from the original rather than compressing the original) How can I do this?

Or should I be using another compression package?
 
Old 10-11-2004, 11:02 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984
what's the difference between "a new zip file from the original" and "compressing the original"... ?
 
Old 10-11-2004, 11:04 AM   #3
glenn69
Member
 
Registered: Jul 2003
Location: Chicagoland
Distribution: ArchLinux
Posts: 261

Original Poster
Rep: Reputation: 32
Well I'm just a bit uncomfortable about "changing" the original every day. if something were to go wrong in the compression process, we would be out of luck.
 
Old 10-11-2004, 11:08 AM   #4
glenn69
Member
 
Registered: Jul 2003
Location: Chicagoland
Distribution: ArchLinux
Posts: 261

Original Poster
Rep: Reputation: 32
Also, the file has to be unzipped to be usable on our system. I'd rather not have to compress it, then send it, then uncompress it. Too many chances for data to be corrupted. I may be overreacting, I adimit that.
 
Old 10-11-2004, 11:48 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984
ooohhhh yuou mean it doesn't leave the original file there? right... personally i'd say use tar instead:
Code:
tar -zcvf file.tar.gz file
this will leave the original file intact.
 
Old 10-12-2004, 12:20 AM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 7.7 (?), Centos 8.1
Posts: 18,174

Rep: Reputation: 2681Reputation: 2681Reputation: 2681Reputation: 2681Reputation: 2681Reputation: 2681Reputation: 2681Reputation: 2681Reputation: 2681Reputation: 2681Reputation: 2681
From the man page for gzip:

gzip -c file1 > foo.gz

leaves file1 unchanged, creates foo.gz .
 
  


Reply


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
A truly general question CrazyDelta Linux - General 2 05-17-2005 08:03 PM
Solaris 8 gzip issues- cannot gzip -d lynx sixosix Solaris / OpenSolaris 4 03-13-2005 03:17 PM
gzip gunzip / unzipping kismet brings freaky friday question for newbie SBrogan Linux - Software 3 09-22-2004 12:53 PM
simple gzip question LinuxBlackBox Linux - Newbie 2 02-04-2004 07:06 PM
mkisofs -z (compression question) minion01 Linux - Newbie 1 12-20-2003 12:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:58 AM.

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
Open Source Consulting | Domain Registration