LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-30-2005, 01:16 PM   #1
rayia
LQ Newbie
 
Registered: Dec 2005
Posts: 2

Rep: Reputation: 0
tar a date range


I'm trying to figure out how to tar a set of log files based on date range, but so far I'm getting frustrated by not finding the correct date combination. I've tryed:

'tar cvNf testarchive --newer=200511010001 [file names]'

Any help on how badly I've messed up the line?
 
Old 12-30-2005, 02:00 PM   #2
Finlay
Senior Member
 
Registered: Mar 2003
Location: Seattle
Distribution: Slackware ?-14.1
Posts: 1,029

Rep: Reputation: 47
i would use
ls
then pipe | it through
grep
if you need to fine tune it, then pipe | it through
tar
 
Old 12-31-2005, 10:18 AM   #3
eddiebaby1023
Member
 
Registered: May 2005
Posts: 378

Rep: Reputation: 33
find is the tool to get your file list, Checkout the -newer and -mtime options.
 
Old 01-03-2006, 07:52 AM   #4
rayia
LQ Newbie
 
Registered: Dec 2005
Posts: 2

Original Poster
Rep: Reputation: 0
Got it working!

Thanks for the help. Here's the line I ended up with:

tar cfvz filename.tgz `find ./200* -ctime +60 ! -ctime +90`

The log files are from a Checkpoint firewall. I only want them left there for 60 days and then I pull them off to a server with a CD burner. All the names begin with yyyy, hence the 200*.

Now If I can just virtualize the filename and automate the FTP.....

Thanks again
 
  


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
how can i decompress this tar.tar file? hmmm sounds new.. tar.tar.. help ;) kublador Linux - Software 14 10-25-2016 02:48 AM
Getting date format right in tar incremental backup jonr Linux - Software 3 08-19-2004 09:53 AM
tar file name with system date mnauta Linux - General 4 12-19-2003 04:48 PM
Set name of tar file as date using bash otisthegbs Linux - Software 5 12-18-2003 03:34 PM
lastlog date does not match system date? jcmj Linux - Networking 6 10-22-2002 12:09 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:23 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
Open Source Consulting | Domain Registration