You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
add --partial flag to transfer as temporary partial file #3770
How do you think rclone should be changed to solve that?
Adding an argument to allow a custom partial extension (eg. --partial-extension=part),
or a bool argument to enable the partial extension (eg. --partial-extension),
or a permanent partial extension hardcoded.
This was discussed in the forum, but I can't find the issue created to develop it.
My personal situation utilizes mergerfs to join a local writable drive with a readonly version of my crypt. This allows wget/curl/aria/etc to skip completed transfers which have already been sent to cloud storage or have already been downloaded locally. Simultaneously, I have an rclone systemd script reading from that local drive only to process the uploading task. This provides a fairly seamless experience when reading or writing data, unless it's readonly on the cloud.
I'm proposing a .part / .incomplete / .unconfirmed to allow separate upload instances of rclone to ignore files which have not finished downloading locally.
Reacted by Ivan Andreev, Konstanin Kelemen, Paul Madden, red thing, flying, Qualous, Simon, Max Kagamine, justinxfisher, Equim and 2 more
I think what you are asking is that when rclone is doing a transfer instead of writing direct to filename it writes to filename.partial then renames filename.partial to filename at the end of the transfer.
Taking a cue from rsync, what it does is make a filename~123123 file if I remember rightly, then it renames that to filename at the end of the sync. Perhaps an extension like .partial.123123 might be the best way - you could still filter on that.
Thoughts
not all backends can rename files
most backends the upload and replacement of a file is atomic (eg you can't have a half written file)
notable exceptions - local, sftp
so this is only really useful with local or sftp
adding things to the file name means rclone is more likely to hit path name limits
Rsync has an option called --partial which if you set it it means that it won't delete partially uploaded files on error. rclone could potentially have this too.
Rsync also has an option called --partial-dir which is a directory that files get uploaded into before being moved into the correct place.
What do you think?
Reacted by opsoyo, Ivan Andreev, mjrawesome, qitsweauca, Levi Roberts and adnoh
I think what you are asking is that when rclone is doing a transfer instead of writing direct to filename it writes to filename.partial then renames filename.partial to filename at the end of the transfer.
You've read my mind!
not all backends can rename files...
I do want to clarify that my interest in this is not a matter of the remote. Rather, I want this for local purposes only. At minimum, I have two rclone instances: one which uploads and one which downloads to/from the same directory (read: prevent duplicates). I would like rclone transfers from elsewhere to local with the .partial so the rclone uploading can ignore the .partial
@aleksandrserbin I propose that we attempt to emulate the --partial flag that rsync uses.
Here is a brief outline of what we need to do...
This needs to be a global flag and the local backend needs to support it. It would probably be a good idea if the sftp backend supports it too (stretch goal!).
Adding a global flag is relatively straight forward (edit fs/config.go and fs/config/configflags/configflags.go)
The implementation needs to be in fs/local/local.go
Rclone now uploads to a temporary file and renames it on backends with the PartialUploads feature, with --partial-suffix to choose the suffix and --inplace to turn it off. Closing as implemented.
Activity
ncw commentedon Nov 29, 2019
I think what you are asking is that when rclone is doing a transfer instead of writing direct to
filenameit writes tofilename.partialthen renamesfilename.partialtofilenameat the end of the transfer.Taking a cue from rsync, what it does is make a
filename~123123file if I remember rightly, then it renames that tofilenameat the end of the sync. Perhaps an extension like.partial.123123might be the best way - you could still filter on that.Thoughts
Rsync has an option called
--partialwhich if you set it it means that it won't delete partially uploaded files on error. rclone could potentially have this too.Rsync also has an option called
--partial-dirwhich is a directory that files get uploaded into before being moved into the correct place.What do you think?
opsoyo commentedon Nov 29, 2019
You've read my mind!
I do want to clarify that my interest in this is not a matter of the remote. Rather, I want this for local purposes only. At minimum, I have two rclone instances: one which uploads and one which downloads to/from the same directory (read: prevent duplicates). I would like rclone transfers from elsewhere to local with the
.partialso the rclone uploading can ignore the.partialncw commentedon Dec 3, 2019
Do you want to work on this?
opsoyo commentedon Dec 3, 2019
aleksandrserbin commentedon Dec 13, 2019
ncw commentedon Dec 17, 2019
@aleksandrserbin I propose that we attempt to emulate the
--partialflag that rsync uses.Here is a brief outline of what we need to do...
This needs to be a global flag and the local backend needs to support it. It would probably be a good idea if the sftp backend supports it too (stretch goal!).
Adding a global flag is relatively straight forward (edit
fs/config.goandfs/config/configflags/configflags.go)The implementation needs to be in
fs/local/local.goHere is where files get opened for write
rclone/backend/local/local.go
Line 957 in 0ecb8bc
And they would need to be renamed after the close here on an else branch
rclone/backend/local/local.go
Line 1007 in 0ecb8bc
Use
random.Stringto make a random extension for files in the form.partial-2343434or something like that (follow roughly what rsync does).aleksandrserbin commentedon Dec 17, 2019
ivandeex commentedon Nov 14, 2020
ivandeex commentedon Feb 14, 2021
[-]Partial download extension[/-][+]Allow transfer as temporary file with custom partial extension[/+]19 remaining items
operations: implement uploads to temp name with --inplace to disable
Prevent partial uploads
Prevent partial uploads
ChintuIdrive commentedon May 13, 2024
Hi @ncw , Does rclone has implemented "--partial-dir=DIR" feature, I didn't found any reference in rclone documentation. can you please confirm
ncw commentedon May 13, 2024
No, rclone doesn't implement
--partial-diryet. It could implement also--partialnow given the--inplacesupport mentioned above.fs: Implement PartialUploads feature flag
operations: implement uploads to temp name with --inplace to disable
feat: Add --partial-resume flag for resumable downloads
ncw commentedon Oct 15, 2026
Rclone now uploads to a temporary file and renames it on backends with the PartialUploads feature, with --partial-suffix to choose the suffix and --inplace to turn it off. Closing as implemented.