LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Sorting all files of home folder modified after a specific date for backup (https://www.linuxquestions.org/questions/linux-general-1/sorting-all-files-of-home-folder-modified-after-a-specific-date-for-backup-541742/)

fc6_user 03-29-2007 05:13 PM

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?

Thanks.

trickykid 03-29-2007 05:37 PM

Hint: Use find with the -mtime option for modified time.

Micro420 03-30-2007 02:24 AM

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


All times are GMT -5. The time now is 01:44 AM.