sync files with potentially different contents but same names!
Clash 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?
rsync backup
add a comment |Â
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?
rsync backup
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
add a comment |Â
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?
rsync backup
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
rsync backup
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
add a comment |Â
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
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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