LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 01-13-2005, 09:03 AM   #1
koda0505
LQ Newbie
 
Registered: Jan 2005
Location: Luxembourg
Posts: 2

Rep: Reputation: 0
tar


Does anybody know how to archive files before a certain date with tar.
I know there is this function --newer.
Thank you very much guys in advance.

Koda0505
 
Old 01-13-2005, 09:53 AM   #2
bbk
Member
 
Registered: Jan 2005
Location: Budapest/Hungary
Distribution: knoppix-hdd/debian
Posts: 56

Rep: Reputation: 15
You can generate the filelist with find and use it's output for tar.
man find

e.g. the command

find /dir/to/backup -ctime -1 -type f

gives all the files which were last changed 1 days and before (the minus sign). so, if you want to tar these files simply extend this with tar:

tar czvf backup.tar.gz `find /dir/to/backup -ctime -1 -type f`

and so on. This is the unix philosophy. Small programs do what they need to do and you can pipe them together :-)

I hope it will solve your problem.
 
Old 01-13-2005, 10:21 AM   #3
Error1312
Member
 
Registered: Feb 2004
Location: Belgium
Distribution: Ubuntu 10.04 Lucid Lynx
Posts: 140

Rep: Reputation: 15
You could also write a shell script.
 
Old 01-14-2005, 05:42 AM   #4
koda0505
LQ Newbie
 
Registered: Jan 2005
Location: Luxembourg
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks bbk, I'll try that.

Koda0505
 
  


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
how can i decompress this tar.tar file? hmmm sounds new.. tar.tar.. help ;) kublador Linux - Software 14 10-25-2016 03:48 AM
tar tar cvf - . | (cd /root/; tar xvf -) ewt3y Linux - General 10 02-19-2014 11:55 AM
a tough question 4 u, problem in extracting tar & tar.gz files p_garg Linux - General 5 11-08-2010 12:02 PM
.rpms, .tar.gz, .tgz, .src.rpm, & .tar.bz2 whoots Mandriva 10 10-18-2003 01:08 PM
Diferance between rpm, tar, tar.gz, scr.tar, etc mobassir Linux - General 12 08-21-2003 07:30 AM


All times are GMT -5. The time now is 12:28 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