Re: Here is a cool script to compress your mail files!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxx

with a message of: 

subscribe


-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux