LinuxQuestions.org
Help answer threads with 0 replies.
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-04-2010, 01:09 AM   #1
shravee
Member
 
Registered: Sep 2009
Posts: 75

Rep: Reputation: 15
Post listing files selectively and then zipping them.


Hi all,

I need to list the files only from 23:00 to 23:30 on 3rd oct 2010 from a directory and then zip them and have it.
please help me with the commands to how to execute the same.

regards,
shravan
 
Old 10-04-2010, 01:33 AM   #2
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,246

Rep: Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684
man find
man tar
 
Old 10-04-2010, 02:14 AM   #3
Bryanlee
Member
 
Registered: May 2005
Location: Honolulu, HI
Distribution: Ubuntu 10.04
Posts: 56

Rep: Reputation: 15
This should find the files you need.

find /home/user -mmin -1350 -mmin -1380 -daystart
 
Old 10-04-2010, 02:24 AM   #4
fbsduser
Member
 
Registered: Oct 2009
Distribution: Hackintosh, SlackWare
Posts: 267

Rep: Reputation: 30
Building up on BryanLee's script. I can add this:
find /home/user -mmin -1350 -mmin -1380 -daystart | tar cvf
 
Old 10-04-2010, 05:15 AM   #5
shravee
Member
 
Registered: Sep 2009
Posts: 75

Original Poster
Rep: Reputation: 15
q1)the filestamp is in 24 hour format..
q2)atime ctime or mtime which option of find should i follow.
plz let me know if this is correct.

find . -ctime 23:00 | tar -cvf logs.tar

regards
shravan
 
Old 10-04-2010, 05:23 AM   #6
murugesan
Member
 
Registered: May 2003
Posts: 151

Rep: Reputation: 28
An example command:
Code:
find /home/user -type f -mmin -1350 -mmin -1380 -daystart  | xargs tar -cvf  murugesan.tar 2>&1 | grep -v murugesan.tar
 
  


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
selectively check in multiple files using SVN sneakyimp Linux - Software 2 01-12-2010 05:19 PM
Zipping files by a date range nixusr Linux - Newbie 3 06-10-2008 01:14 PM
Zipping of files rajesh_b Programming 5 10-27-2004 07:02 AM
zipping files with a script quickk Linux - Newbie 8 09-17-2004 10:32 AM
zipping/compressing folders and files DiZASTiX Linux - Newbie 1 05-26-2003 09:48 PM


All times are GMT -5. The time now is 10:36 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration