Hi all, I'd like to modify rsync to add a flag to compare the MD5 signature of the unencoded audio data in the header of a FLAC file to determine whether or not to transfer a file. The reason being that I've got a large number of FLAC files, many of which are corrupted in the destination volume, but many of which are valid but the tags have been modified. The sizes of both the source and destination files are the exact same, regardless of whether they're corrupted or not. If I were to rsync all files based on the modification date, it would overwrite these valid FLAC files whose tags have been altered, which I want to prevent. I only want to rsync new files and files whose MD5 signatures don't match. If anyone could point me in the right direction of where in the source code I should concentrate my efforts to add this modification, it would help greatly. Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.samba.org/pipermail/rsync/attachments/20141202/8a88c1fa/attachment.html>
At 02:24 02.12.2014, Mike Garey wrote:>Hi all, I'd like to modify rsync to add a flag to compare the MD5 signature of the unencoded audio data in the header of a FLAC file to determine whether or not to transfer a file. ? > >The reason being that I've got a large number of FLAC files, many of which are corrupted in the destination volume, but many of which are valid but the tags have been modified.? The sizes of both the source and destination files are the exact same, regardless of whether they're corrupted or not.? If I were to rsync all files based on the modification date, it would overwrite these valid FLAC files whose tags have been altered, which I want to prevent.? I only want to rsync new files and files whose MD5 signatures don't match. > >If anyone could point me in the right direction of where in the source code I should concentrate my efforts to add this modification, it would help greatly.You'd probably get a result faster with less problems (future updates) if you separate your logic into a single program instead of incorporating it into rsync. If you have a way of accessing both the source and dest then you can create a list of files to sync and feed this to rsync with --files-from. Or you run your script/program on the destination, check all files and create the list which you can then transfer to the source and let rsync run. Or you have rsync run on the destination if you have a server on or direct access to the source. If you really want to change rsync you can probably look at -c (checksum) which you may be able to adjust to use the header's checksum instead of generating a file's checksum. But I don't know the source code. bye Fabi
yes, i`d second that. maybe you just try using metaflac to generate the appropriate list of files to sync and then feed that list to rsync.> Gesendet: Dienstag, 02. Dezember 2014 um 08:37 Uhr > Von: "Fabian Cenedese" <Cenedese at indel.ch> > An: rsync at lists.samba.org > Betreff: Re: Comparing FLAC header before syncing > > At 02:24 02.12.2014, Mike Garey wrote: > >Hi all, I'd like to modify rsync to add a flag to compare the MD5 signature of the unencoded audio data in the header of a FLAC file to determine whether or not to transfer a file. ? > > > >The reason being that I've got a large number of FLAC files, many of which are corrupted in the destination volume, but many of which are valid but the tags have been modified.? The sizes of both the source and destination files are the exact same, regardless of whether they're corrupted or not.? If I were to rsync all files based on the modification date, it would overwrite these valid FLAC files whose tags have been altered, which I want to prevent.? I only want to rsync new files and files whose MD5 signatures don't match. > > > >If anyone could point me in the right direction of where in the source code I should concentrate my efforts to add this modification, it would help greatly. > > You'd probably get a result faster with less problems (future updates) if you > separate your logic into a single program instead of incorporating it into rsync. > If you have a way of accessing both the source and dest then you can create > a list of files to sync and feed this to rsync with --files-from. Or you run your > script/program on the destination, check all files and create the list which > you can then transfer to the source and let rsync run. Or you have rsync run > on the destination if you have a server on or direct access to the source. > > If you really want to change rsync you can probably look at -c (checksum) > which you may be able to adjust to use the header's checksum instead > of generating a file's checksum. But I don't know the source code. > > bye Fabi > > > > -- > Please use reply-all for most replies to avoid omitting the mailing list. > To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync > Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html >