[prev in list] [next in list] [prev in thread] [next in thread] 

List:       redhat-list
Subject:    Re: Here is a cool script to compress your mail files!
From:       Mike Burger <mburger () bubbanfriends ! org>
Date:       2004-05-30 3:50:58
Message-ID: Pine.LNX.4.58.0405292247260.29792 () burgers ! bubbanfriends ! org
[Download RAW message or body]

On Sat, 29 May 2004, Jake Johnson wrote:

> Here is a cool script for anyone that has really big email files and wants to have them compressed.
> 
> 
> #!/bin/bash
> for file in `ls | grep -v gz$ | grep -v sh$`
> do
> echo "Compressing $file..."
> gzip -c $file >> $file.gz
> rm $file
> touch $file
> done

Side note to what everyone else said...

You don't really have to use the -c, pipe it to the gz file, or rm and 
touch the file.

You could probably get away with:

gzip $file
touch $file.

By just issuing gzip against the file, it will automatically add the .gz 
extension to the file, after having compressed it, and the original file 
name will no longer exist.

Running "touch" to recreate the file may not be necessary, either, as 
procmail is usually capable of creating the mail spool file (default 
INBOX, or other files in your maildir) if it doesn't already exist.

-- 
Mike Burger
http://www.bubbanfriends.org

Visit the Dog Pound II BBS
telnet://dogpound2.citadel.org or http://dogpound2.citadel.org:2000

To be notified of updates to the web site, visit 
http://www.bubbanfriends.org/mailman/listinfo/site-update, or send a 
message to:

site-update-request@bubbanfriends.org

with a message of: 

subscribe


-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic