The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
UNIX newbie NEWBIE question! Hanamachi UNIX for Dummies Questions & Answers 4 03-28-2009 04:10 PM
A easy question. kikikaka Shell Programming and Scripting 6 11-02-2004 08:07 PM
Another easy question catbad UNIX for Dummies Questions & Answers 3 04-04-2003 11:06 AM
easy question tamemi UNIX for Dummies Questions & Answers 3 07-03-2002 04:08 AM
Easy question Bab00shka UNIX for Dummies Questions & Answers 4 07-02-2002 07:57 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 02-22-2008
adrockrocks adrockrocks is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 2
Newbie with an easy question

I'm looking to write a script that takes a certain directory and gzips all its files that are older than 2 days. I've done some research but for the life of me, I can't even get any files gzipped. Any help would be greatly appreciated!
  #2 (permalink)  
Old 02-22-2008
KevinADC KevinADC is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2008
Posts: 731
post any code you have written so far to try and accomplish your goal.
  #3 (permalink)  
Old 03-17-2008
adrockrocks adrockrocks is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 2
Gzip script

find /folder/path -mtime +2 -exec gzip {} \;

This is what I've come up with so far. Is there a benefit to adding -f to this script? Also, is there a command that would list out the files that were zipped after the above is performed?

Thanks
  #4 (permalink)  
Old 03-17-2008
era
Guest
  
 

Posts: n/a
Bits: 0 [Banking]
gzip has a verbose option (IIRC -v) so it will tell you what it zips.

How was this not working for you?

I don't see what adding an -f option would help. Sounds more like taking a risk.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:01 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0