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
Zipping files older than one month ramky79 Shell Programming and Scripting 2 04-07-2008 04:39 PM
Zipping dreams5617 UNIX for Dummies Questions & Answers 1 02-11-2007 08:03 PM
Zipping the dir dreams5617 Shell Programming and Scripting 1 07-26-2006 12:20 AM
tar'ing and zipping files FredSmith UNIX for Dummies Questions & Answers 4 05-02-2006 03:09 PM
zipping across platforms MizzGail UNIX for Dummies Questions & Answers 8 05-19-2005 01:01 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-21-2008
shary shary is offline
Registered User
  
 

Join Date: Jan 2007
Posts: 61
zipping files

Dear Experts,

I need a script which will zipped the files older than 2 days.
but i dont want to use find . * -mtime 2.
Is there is any other method to achive this task.
i will ececute the script daily.

Regards,
  #2 (permalink)  
Old 07-21-2008
danmero danmero is online now Forum Advisor  
  
 

Join Date: Nov 2007
Location: 45.48-73.63
Posts: 1,368
man find
Code:
find . -type f -mtime +2 -exec gzip {} \;
  #3 (permalink)  
Old 07-21-2008
matrixmadhan matrixmadhan is online now Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,932
Quote:
Originally Posted by shary View Post
Dear Experts,

I need a script which will zipped the files older than 2 days.
but i dont want to use find . * -mtime 2.
Is there is any other method to achive this task.
i will ececute the script daily.

Regards,
Not specifically picking on you - and sorry if this is something offending

Why is that you don't want to use mtime - there should be some reason behind that. I hope so

If that is something shareable please do let us know about that.

Reason could be anything
1) don't like mtime
2) trying out different options
3) option not supported ( this is not obvious )
4) or any other reason

options are there to help us, ease of usage and quickly achieve what is required.

I don't understand why a specific option should not be used.
  #4 (permalink)  
Old 07-21-2008
ynilesh's Avatar
ynilesh ynilesh is offline
Registered User
  
 

Join Date: Oct 2007
Location: Bangalore, India.
Posts: 222
Simple option,
1. use `ls -al`
2. look at the 6th field and play with that timestamp.

- nilesh
Sponsored Links
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 02:34 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
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