Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 03-29-2007, 05:13 PM   #1
Registered: Jan 2007
Location: Montpellier, France
Distribution: Fedora Core 6, Mandriva, Knoppix, Debian
Posts: 143

Rep: Reputation: 15
Data backup: Sorting all files of home directory modified after a specific date

Hi all!

Here's what I'd like to be able to do. I'm sure it's possible, but not sure how to go about it using the command line.

Let's say I burned my entire home directory on November 1, 2006 onto a DVD. I'd now like to burn a new backup DVD, but I don't want to recopy all of the stuff I'd already saved on Nov 1, 2006, just the files that were written or modified on and after Nov 1, 2006; in other words, all files in the home directory, but also all files in all subdirectories written/modified after Nov 1, 2006. I would like to leave the home directory intact (no changes). Is this possible?

I know that 'ls -tl' lists files in order from the most recently modified/written to the least recent. The recursive (-r) option could be used, and I could also pipe the results of it into another command... copy them (cp) into another directory, for example. I could then burn the contents of the new directory and discard it once the DVD has been burned. I can't figure out how to choose a specific date and time and to get only the files that were written/modified after that point. Even if I did know how to do that, I wouldn't know what the best way of doing so would be.

Any takers?


Last edited by fc6_user; 03-30-2007 at 07:32 AM.
Old 03-29-2007, 05:37 PM   #2
LQ Guru
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 267Reputation: 267Reputation: 267
Hint: Use find with the -mtime option for modified time.
Old 03-30-2007, 02:24 AM   #3
Senior Member
Registered: Aug 2003
Location: Berkeley, CA
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986

Rep: Reputation: 45
tar --newer-mtime 2006-11-01 -czvf /backupdir/filename.tar.gz /home
SUppose could work with the find command
find /home -mtime 150 -print | xarg cp -r * /backupdir

Last edited by Micro420; 03-30-2007 at 02:27 AM.


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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
rsync: only backup recently modified files hamish Linux - Software 3 09-20-2011 09:55 AM
Having problem on sorting my files to the correct folder New2Linux06 Linux - General 3 11-04-2006 04:22 AM
Sorting files by time / date. TheRealDeal Linux - General 2 08-06-2006 09:35 PM
sorting the same kind of files in a folder? lenny45 MEPIS 11 05-08-2006 11:45 AM
backup program for backing up only modified files | 'snapshot' ibm5_25 Linux - Software 2 01-10-2004 12:28 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:27 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration