LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux > Linux - General
User Name
Password
Linux - General This 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.

Notices

Reply
 
Thread Tools
Old 03-29-2007, 06:13 PM   #1
fc6_user
Member
 
Registered: Jan 2007
Location: Montpellier, France
Distribution: Fedora Core 6, Mandriva, Knoppix, Debian
Posts: 143
Thanked: 0
Data backup: Sorting all files of home directory modified after a specific date


[Log in to get rid of this advertisement]
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?

Thanks.

Last edited by fc6_user; 03-30-2007 at 08:32 AM..
fc6_user is offline     Reply With Quote
Old 03-29-2007, 06:37 PM   #2
trickykid
Guru
 
Registered: Jan 2001
Posts: 23,977
Thanked: 8
Hint: Use find with the -mtime option for modified time.
trickykid is offline     Reply With Quote
Old 03-30-2007, 03:24 AM   #3
Micro420
Senior Member
 
Registered: Aug 2003
Location: Berkeley, CA
Distribution: Mac OS X Leopard 10.5.5, Windows 2003 Server/Vista/XP/2000/NT/98, Ubuntux64, CentOS4.7/5.2
Posts: 2,980
Thanked: 0
Code:
tar --newer-mtime 2006-11-01 -czvf /backupdir/filename.tar.gz /home
SUppose could work with the find command
Code:
find /home -mtime 150 -print | xarg cp -r * /backupdir

Last edited by Micro420; 03-30-2007 at 03:27 AM..
Micro420 is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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
Having problem on sorting my files to the correct folder New2Linux06 Linux - General 3 11-04-2006 05:22 AM
Sorting files by time / date. TheRealDeal Linux - General 2 08-06-2006 10:35 PM
sorting the same kind of files in a folder? lenny45 MEPIS 11 05-08-2006 12:45 PM
rsync: only backup recently modified files hamish Linux - Software 2 09-05-2005 03:51 PM
backup program for backing up only modified files | 'snapshot' ibm5_25 Linux - Software 2 01-10-2004 01:28 AM


All times are GMT -5. The time now is 02:17 PM.

Main Menu
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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration