LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-26-2013, 11:39 AM   #1
jat421
LQ Newbie
 
Registered: May 2012
Posts: 12

Rep: Reputation: Disabled
How to avoid the copy of the same file but with different name using rsync?


Hi, I am using rsync on windows and trying to sync a huge SQL DB file. The problem I am having is that the source file name changes everyday but the destination file will remain the same and when the names are different rsync copies the whole file again. Any ideas on how I can make this work? Thanks!


rsync.exe -avz /cygdrive/x/database_backups/default/full_backup_2013-02-25-01.00.bak /cygdrive/d/Temp/full_backup.bak
 
Old 02-26-2013, 11:43 AM   #2
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
So are you saying that another backup is made with a different timestamp in the filename but the files are actaully the exact same and you dont want to re-copy it again if they are?


If that is the case you could use hashing like and md5sum and compare the md5s then if they are different copy if not then exit. Would require a little scripting.
 
Old 02-26-2013, 11:59 AM   #3
jat421
LQ Newbie
 
Registered: May 2012
Posts: 12

Original Poster
Rep: Reputation: Disabled
sorry, I think was wasn't clear enough. You are right the timestamp and the filename changes everyday on the source but their could be new data added to the .bak on the source. I want to sync the source and destination files so only part of the file is transferred that is changed. Rsync can do differential sync.
 
Old 02-26-2013, 12:08 PM   #4
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
You don't want to do this with SQL backups. You will want to look into transaction log backups. Due to the way databases work incrementing a .bak file is not really a good option.


Basically you can do a weekly full backup of your SQL database then do daily or even hourly transaction log backups. Then if you need to restore you can apply the the t-logs up to teh date/time you want to get to.

Take a look at:

http://msdn.microsoft.com/en-us/libr...sql.80%29.aspx
http://msdn.microsoft.com/en-us/library/ms179478.aspx
 
Old 02-26-2013, 12:45 PM   #5
jat421
LQ Newbie
 
Registered: May 2012
Posts: 12

Original Poster
Rep: Reputation: Disabled
Thanks Kustom42 for your help. Yea I was hoping I will not have to take that path but looks like that's what I might need to do then. Hopefully I can find a way to automate it as I use the destination DB on the other server for reporting and need to load it every night . Thanks for your help!
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] copy files with rsync or dd vnc Linux - Newbie 4 02-07-2013 05:51 AM
rsync syntax for local copy hoover93 Linux - Software 3 12-21-2012 02:39 AM
rsync to copy specific files kilee Linux - Newbie 4 01-15-2011 08:23 AM
rsync: how to copy file, "Operation not permitted" nugroho2 Linux - Laptop and Netbook 3 04-21-2010 07:57 AM
Series of rsync backups over SSH - avoid multiple logins Meson Linux - Server 1 04-25-2008 07:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:17 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
Open Source Consulting | Domain Registration