Skip to content

b2: clean previous file versions #462

Closed

Description

@witq

Hi, I'm using rclone to make a copy of my time machine backups. Since the introduction of mod time based checking, I'm getting a lot more uploads. I guess this is fine, but since there is no option to remove previous file versions, my bucket size is growing really fast now. So, I think a command or an option to remove previous versions upon upload could be very useful in such cases.

Activity

  1. ncw commented on Apr 29, 2016

    @ncw
    Member

    Good idea.

    I could see this working with a flag --b2-no-versions which if set would mean

    • after uploading a file, delete any older versions of that file

    Or alternatively I could add a flag (or command) which deleted all the older versions. If it was a command it could be called emptytrash or cleanup or something like that. This could then be adapted to the other Fs which have the concept of trash that you can empty (eg Drive).

  2. witq commented on Apr 29, 2016

    @witq
    Author

    I'm glad to hear I got you interested in this. I think combining the two solutions would be ideal but a separate command like cleanup would be fine too – it would just need to be executed after each backup session.

  3. shuhaowu commented on Jun 3, 2016

    @shuhaowu

    Are there any progress on this? I'm currently working on my backup system and stumbled upon this. While this is not a problem for now as I'm not done with all the other parts yet, I would like to know if there are any timeline to get this functionality to work as it will definitely become an issue at one part

    I can potentially take this on if there is no timeline in getting this to work, but I'm not sure if I will have the time right now.

  4. ncw commented on Jun 3, 2016

    @ncw
    Member

    I'm not working on this at the moment, so any help much appreciated :-) To implement the cleanup command I'd add an optional interface CleanUp to the Fs which would then remove all the trash for a given Fs. This could then be implemented for b2 and later for drive, acd, onedrive all of which have trash which can be emptied.

  5. added this to the v1.31 milestone on Jun 18, 2016
  6. NoSyu commented on Jul 13, 2016

    @NoSyu

    Hello @ncw
    When I move the files in local and run sync, the latest previous file version is changed to 'hidden' state.
    The size of the file version is zero, but it still shows in the file lists of the bucket.

    To delete hidden and alone files in cleanup operation, I wrote the code. It works well in my case.

    Now, I am curious about the reason to remain the hidden files. Are there any speical reasons?
    If not, could I push the branch and pull requests?

    Thank you
    Yours sincerely

  7. dpc commented on May 3, 2017

    @dpc

    @NoSyu - looks like b2 now has "lifetime" settings accessible from a web interface that allow control over how long "hidden" files stick around and when they get deleted.

  8. LinuxOnTheDesktop commented on Dec 18, 2021

    @LinuxOnTheDesktop

    looks like b2 now has "lifetime" settings accessible from a web interface that allow control over how long "hidden" files stick around and when they get deleted.

    Yes, but even if one uses that GUI to tell b2 to delete files immediately, rclone still manages to treat a deleted file, for a day, as if it were not deleted (!). See #2403.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions