LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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, 12:09 AM   #1
shravee
Member
 
Registered: Sep 2009
Posts: 84

Rep: Reputation: 16
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, 12:33 AM   #2
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192
man find
man tar
 
Old 10-04-2010, 01: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, 01: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, 04:15 AM   #5
shravee
Member
 
Registered: Sep 2009
Posts: 84

Original Poster
Rep: Reputation: 16
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, 04:23 AM   #6
murugesan
Member
 
Registered: May 2003
Location: Bangalore ,Karnataka, India, Asia, Earth, Solar system, milky way galaxy, black hole
Distribution: murugesan openssl
Posts: 181

Rep: Reputation: 29
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



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 04:19 PM
Zipping files by a date range nixusr Linux - Newbie 3 06-10-2008 12:14 PM
Zipping of files rajesh_b Programming 5 10-27-2004 06:02 AM
zipping files with a script quickk Linux - Newbie 8 09-17-2004 09:32 AM
zipping/compressing folders and files DiZASTiX Linux - Newbie 1 05-26-2003 08:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:20 PM.

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
Open Source Consulting | Domain Registration