sync files with potentially different contents but same names!

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I backup some photo directories on my phone into a folder on a Linux machine like this:



rsync -rtvu source_dir/ destination_dir/


It works very well, the destination directory could contain hundreds of files, but only a few new ones from the source are copied over.



Anyway, I just tried the same command with an old camcorder I rarely use and noticed that it does not name the files in a sensible way like the phone, including a date or timestamp, but gives them non-unique names like this:



00000.MTS 00004.MTS 00008.MTS 00012.MTS 00016.MTS 00020.MTS
00001.MTS 00005.MTS 00009.MTS 00013.MTS 00017.MTS 00021.MTS
00002.MTS 00006.MTS 00010.MTS 00014.MTS 00018.MTS 00022.MTS
00003.MTS 00007.MTS 00011.MTS 00015.MTS 00019.MTS


I had planned on emptying this SD card, and filming something else but this backup command is not fool-proof I don't think - rsync looks at the file names not the contents of the files I think.



Is this true? Can one get rsync to say check the hash of the files for similarity and rename them otherwise, or is there another appropriate solution?










share|improve this question





















  • rsync focuses on files that have changed in size or last-modified time
    – Raman Sailopal
    Oct 2 '17 at 15:21










  • so will it overwrite a file with the same name but totally different content and a newer date?
    – cardamom
    Oct 2 '17 at 15:30






  • 1




    As far as I know yes. Changes in data bytes would normally be dealt with by a file system syncing tool such as drbd.
    – Raman Sailopal
    Oct 3 '17 at 8:22














up vote
0
down vote

favorite












I backup some photo directories on my phone into a folder on a Linux machine like this:



rsync -rtvu source_dir/ destination_dir/


It works very well, the destination directory could contain hundreds of files, but only a few new ones from the source are copied over.



Anyway, I just tried the same command with an old camcorder I rarely use and noticed that it does not name the files in a sensible way like the phone, including a date or timestamp, but gives them non-unique names like this:



00000.MTS 00004.MTS 00008.MTS 00012.MTS 00016.MTS 00020.MTS
00001.MTS 00005.MTS 00009.MTS 00013.MTS 00017.MTS 00021.MTS
00002.MTS 00006.MTS 00010.MTS 00014.MTS 00018.MTS 00022.MTS
00003.MTS 00007.MTS 00011.MTS 00015.MTS 00019.MTS


I had planned on emptying this SD card, and filming something else but this backup command is not fool-proof I don't think - rsync looks at the file names not the contents of the files I think.



Is this true? Can one get rsync to say check the hash of the files for similarity and rename them otherwise, or is there another appropriate solution?










share|improve this question





















  • rsync focuses on files that have changed in size or last-modified time
    – Raman Sailopal
    Oct 2 '17 at 15:21










  • so will it overwrite a file with the same name but totally different content and a newer date?
    – cardamom
    Oct 2 '17 at 15:30






  • 1




    As far as I know yes. Changes in data bytes would normally be dealt with by a file system syncing tool such as drbd.
    – Raman Sailopal
    Oct 3 '17 at 8:22












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I backup some photo directories on my phone into a folder on a Linux machine like this:



rsync -rtvu source_dir/ destination_dir/


It works very well, the destination directory could contain hundreds of files, but only a few new ones from the source are copied over.



Anyway, I just tried the same command with an old camcorder I rarely use and noticed that it does not name the files in a sensible way like the phone, including a date or timestamp, but gives them non-unique names like this:



00000.MTS 00004.MTS 00008.MTS 00012.MTS 00016.MTS 00020.MTS
00001.MTS 00005.MTS 00009.MTS 00013.MTS 00017.MTS 00021.MTS
00002.MTS 00006.MTS 00010.MTS 00014.MTS 00018.MTS 00022.MTS
00003.MTS 00007.MTS 00011.MTS 00015.MTS 00019.MTS


I had planned on emptying this SD card, and filming something else but this backup command is not fool-proof I don't think - rsync looks at the file names not the contents of the files I think.



Is this true? Can one get rsync to say check the hash of the files for similarity and rename them otherwise, or is there another appropriate solution?










share|improve this question













I backup some photo directories on my phone into a folder on a Linux machine like this:



rsync -rtvu source_dir/ destination_dir/


It works very well, the destination directory could contain hundreds of files, but only a few new ones from the source are copied over.



Anyway, I just tried the same command with an old camcorder I rarely use and noticed that it does not name the files in a sensible way like the phone, including a date or timestamp, but gives them non-unique names like this:



00000.MTS 00004.MTS 00008.MTS 00012.MTS 00016.MTS 00020.MTS
00001.MTS 00005.MTS 00009.MTS 00013.MTS 00017.MTS 00021.MTS
00002.MTS 00006.MTS 00010.MTS 00014.MTS 00018.MTS 00022.MTS
00003.MTS 00007.MTS 00011.MTS 00015.MTS 00019.MTS


I had planned on emptying this SD card, and filming something else but this backup command is not fool-proof I don't think - rsync looks at the file names not the contents of the files I think.



Is this true? Can one get rsync to say check the hash of the files for similarity and rename them otherwise, or is there another appropriate solution?







rsync backup






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Oct 2 '17 at 14:53









cardamom

1032




1032











  • rsync focuses on files that have changed in size or last-modified time
    – Raman Sailopal
    Oct 2 '17 at 15:21










  • so will it overwrite a file with the same name but totally different content and a newer date?
    – cardamom
    Oct 2 '17 at 15:30






  • 1




    As far as I know yes. Changes in data bytes would normally be dealt with by a file system syncing tool such as drbd.
    – Raman Sailopal
    Oct 3 '17 at 8:22
















  • rsync focuses on files that have changed in size or last-modified time
    – Raman Sailopal
    Oct 2 '17 at 15:21










  • so will it overwrite a file with the same name but totally different content and a newer date?
    – cardamom
    Oct 2 '17 at 15:30






  • 1




    As far as I know yes. Changes in data bytes would normally be dealt with by a file system syncing tool such as drbd.
    – Raman Sailopal
    Oct 3 '17 at 8:22















rsync focuses on files that have changed in size or last-modified time
– Raman Sailopal
Oct 2 '17 at 15:21




rsync focuses on files that have changed in size or last-modified time
– Raman Sailopal
Oct 2 '17 at 15:21












so will it overwrite a file with the same name but totally different content and a newer date?
– cardamom
Oct 2 '17 at 15:30




so will it overwrite a file with the same name but totally different content and a newer date?
– cardamom
Oct 2 '17 at 15:30




1




1




As far as I know yes. Changes in data bytes would normally be dealt with by a file system syncing tool such as drbd.
– Raman Sailopal
Oct 3 '17 at 8:22




As far as I know yes. Changes in data bytes would normally be dealt with by a file system syncing tool such as drbd.
– Raman Sailopal
Oct 3 '17 at 8:22















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f395666%2fsync-files-with-potentially-different-contents-but-same-names%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f395666%2fsync-files-with-potentially-different-contents-but-same-names%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay