LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 06-28-2007, 06:59 PM   #1
rm_-rf_windows
Member
 
Registered: Jun 2007
Location: Europe
Distribution: Ubuntu
Posts: 292

Rep: Reputation: 27
Command line: How do I backup files modified after a specific date only


I'd like to backup files that I modified after a specific date, say April 1, 2007 and only those files. I'd also like these files to remain in their specific, corresponding directories and would like the 'tree' to remain as is. Is there a simple way of doing this by running a command or script? I'd then be burning these files onto a DVD. In other words, the last time I would have backed up my data onto DVD would have been April 1, 2007 / March 31, 2007 and I don't want to save what's already been saved.
 
Old 06-28-2007, 08:25 PM   #2
pcardout
Member
 
Registered: Jun 2003
Location: Socorro, New Mexico
Distribution: Debian ("jessie", "squeeze"), Linux Mint (Serena), XUbuntu
Posts: 221

Rep: Reputation: 24
Quote:
Originally Posted by rm_-rf_windows
I'd like to backup files that I modified after a specific date, say April 1, 2007 and only those files. I'd also like these files to remain in their specific, corresponding directories and would like the 'tree' to remain as is. Is there a simple way of doing this by running a command or script? I'd then be burning these files onto a DVD. In other words, the last time I would have backed up my data onto DVD would have been April 1, 2007 / March 31, 2007 and I don't want to save what's already been saved.
Check out rsync. This command will synchronize any two machines, or any two directories
in one machine. It is a REALLY good way to accomplish incremental backups to a USB hard-drive
for example. It checks dates and sizes and only updates the new stuff. It
keeps your file trees intact and can recurse through directories. It is also blazingly
fast. I do not know whether DVD's are rewriteable more than once, but if they are, you could
probably use rsync with DVDs. I really recommend an external hard-drive though. That is a forever
backup solution and you don't have to track all those DVDs.

Last edited by pcardout; 06-28-2007 at 08:26 PM.
 
Old 06-28-2007, 08:34 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally Posted by rm_-rf_windows
I'd like to backup files that I modified after a specific date, say April 1, 2007 and only those files. I'd also like these files to remain in their specific, corresponding directories and would like the 'tree' to remain as is. Is there a simple way of doing this by running a command or script? I'd then be burning these files onto a DVD. In other words, the last time I would have backed up my data onto DVD would have been April 1, 2007 / March 31, 2007 and I don't want to save what's already been saved.
I believe the last backup was 90 days ago?

Code:
find -type f -ctime -90 > new_files.txt
tar czf 20070629.tar.gz -T new_files.txt
[edit]
I found doing the maths with the date ugly ... so I found
a bash-script online that does differences between dates;
if you always know what the last back-up date was you could
use that and maybe make a wrapper or modify it so you don't
need to enter two dates.

http://www.codelibary.com/Bash/24108887.html
[/edit]


Cheers,
Tink

Last edited by Tinkster; 06-28-2007 at 08:52 PM.
 
  


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 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
Sorting all files of home folder modified after a specific date for backup fc6_user Linux - General 2 03-30-2007 02:24 AM
Command line tools to Find files with specific text naps Linux - Software 5 11-15-2004 04:46 AM
backup program for backing up only modified files | 'snapshot' ibm5_25 Linux - Software 2 01-10-2004 12:28 AM
Copying files from a specific date dman65 Linux - Software 3 09-22-2003 10:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:12 PM.

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