Skip to content

add --partial flag to transfer as temporary partial file #3770

Closed

Description

@opsoyo

What is your current rclone version (output from rclone version)?

1.50.2

What problem are you are trying to solve?

Partial download extension, like in Aria

How do you think rclone should be changed to solve that?

  1. Adding an argument to allow a custom partial extension (eg. --partial-extension=part),
  2. or a bool argument to enable the partial extension (eg. --partial-extension),
  3. 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.

Activity

  1. ncw commented on Nov 29, 2019

    @ncw
    Member

    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?

  2. opsoyo commented on Nov 29, 2019

    @opsoyo
    Author

    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

  3. added this to the Help Wanted milestone on Dec 3, 2019
  4. ncw commented on Dec 3, 2019

    @ncw
    Member

    Do you want to work on this?

  5. opsoyo commented on Dec 3, 2019

    @opsoyo
    Author
  6. aleksandrserbin commented on Dec 13, 2019

    @aleksandrserbin
  7. ncw commented on Dec 17, 2019

    @ncw
    Member

    @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

    Here is where files get opened for write

    f, err := file.OpenFile(o.path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0666)

    And they would need to be renamed after the close here on an else branch

    Use random.String to make a random extension for files in the form .partial-2343434 or something like that (follow roughly what rsync does).

  8. aleksandrserbin commented on Dec 17, 2019

    @aleksandrserbin
  9. ivandeex commented on Nov 14, 2020

    @ivandeex
  10. ivandeex commented on Feb 14, 2021

    @ivandeex
  11. changed the title [-]Partial download extension[/-] [+]Allow transfer as temporary file with custom partial extension[/+] on Feb 14, 2021
  12. 19 remaining items

  13. ChintuIdrive commented on May 13, 2024

    @ChintuIdrive

    Hi @ncw , Does rclone has implemented "--partial-dir=DIR" feature, I didn't found any reference in rclone documentation. can you please confirm

  14. ncw commented on May 13, 2024

    @ncw
    Member

    Hi @ncw , Does rclone has implemented "--partial-dir=DIR" feature, I didn't found any reference in rclone documentation. can you please confirm

    No, rclone doesn't implement --partial-dir yet. It could implement also --partial now given the --inplace support mentioned above.

  15. ncw commented on Oct 15, 2026

    @ncw
    Member

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions