Created attachment 10229 [details] the patch I need to sync a lot of files with non-zero-padded numbered filenames. I would like them to be transferred in order, to be able to use "partial" transfers (it takes a lot of time to transfer the whole data). My concrete need is to rsync duplicity backups. Let's say I have 21 files. For now, they are transferred in that order : duplicity-full.20140531T230029Z.vol1.difftar.gpg duplicity-full.20140531T230029Z.vol10.difftar.gpg duplicity-full.20140531T230029Z.vol11.difftar.gpg duplicity-full.20140531T230029Z.vol12.difftar.gpg duplicity-full.20140531T230029Z.vol13.difftar.gpg duplicity-full.20140531T230029Z.vol14.difftar.gpg duplicity-full.20140531T230029Z.vol15.difftar.gpg duplicity-full.20140531T230029Z.vol16.difftar.gpg duplicity-full.20140531T230029Z.vol17.difftar.gpg duplicity-full.20140531T230029Z.vol18.difftar.gpg duplicity-full.20140531T230029Z.vol19.difftar.gpg duplicity-full.20140531T230029Z.vol2.difftar.gpg duplicity-full.20140531T230029Z.vol20.difftar.gpg duplicity-full.20140531T230029Z.vol21.difftar.gpg duplicity-full.20140531T230029Z.vol3.difftar.gpg duplicity-full.20140531T230029Z.vol4.difftar.gpg duplicity-full.20140531T230029Z.vol5.difftar.gpg duplicity-full.20140531T230029Z.vol6.difftar.gpg duplicity-full.20140531T230029Z.vol7.difftar.gpg duplicity-full.20140531T230029Z.vol8.difftar.gpg duplicity-full.20140531T230029Z.vol9.difftar.gpg This is not good, because if the transfer is partial, they are not exploitable (I have to sync all files 10 to 19 – and 100 to 199, 1000 to 1999 – before transferring file 2). Thus, I added a --numeric-sort (-N) option to rsync, to transfer the files in the expected order. Patch attached. Feedbacks welcome.
Created attachment 10230 [details] the patch (v2) An explicit 'int' return type was missing for must_numsort() the patch v1 added. The patch v2 only adds this 'int' (compared to patch v1).
Arf, it breaks file selection and file content under some conditions (remote transfer and partial sync — when some files are already present). So (at least for now), I close this bug/patch.