Repository navigation
Closed
Description
What is the problem you are having with rclone?
The command
rclone sync test/ remoteName:bucketName --fast-list --b2-hard-delete
is still creating versions on B2, not removing old files.
I changed the index.html several times, then issuing the command above. Always getting a new version of the file. Lifecycle settings of the bucket are set keep only the current version.
What is your rclone version (eg output from rclone -V)
rclone v1.42
- os/arch: linux/amd64
- go version: go1.10.1
Which OS you are using and how many bits (eg Windows 7, 64 bit)
Debian stable
Which cloud storage system are you using? (eg Google Drive)
B2
The command you were trying to run (eg rclone copy /tmp remote:tmp)
rclone sync test/ remoteName:bucketName --fast-list --b2-hard-delete
A log from the command with the -vv flag (eg output from rclone -vv copy /tmp remote:tmp)
2018/07/18 14:53:44 DEBUG : index.html: Modification times differ by -3m41.864114454s: 2018-07-18 14:53:37.960114454 +0200 CEST, 2018-07-18 12:49:56.096 +0000 UTC
2018/07/18 14:53:44 DEBUG : index.html: SHA-1 = 39422c5a9980b4e843db2abd0a88b71adafd6b38 (Local file system at /home/user/test)
2018/07/18 14:53:44 DEBUG : index.html: SHA-1 = fa48f8eeaae1769c42336c655aca832f7c7e6a85 (B2 bucket bucketName)
2018/07/18 14:53:44 DEBUG : index.html: SHA-1 differ
2018/07/18 14:53:44 INFO : B2 bucket bucketName: Waiting for checks to finish
2018/07/18 14:53:44 INFO : B2 bucket bucketName: Waiting for transfers to finish
2018/07/18 14:53:46 INFO : index.html: Copied (replaced existing)
2018/07/18 14:53:46 INFO : Waiting for deletions to finish
2018/07/18 14:53:46 INFO :
Transferred: 45 Bytes (8 Bytes/s)
Errors: 0
Checks: 2
Transferred: 1
Elapsed time: 5.2s
Activity
ncw commentedon Jul 18, 2018
I would say rclone is calling the correct API...
First non --hard-delete
Now with --hard-delete
Can you make a little sequence like that which shows the problem - maybe using
rclone ls --b2-versionsto show the versions you aren't expecting?atomtigerzoo commentedon Jul 19, 2018
Why are you using
deletefile? I want to upload/sync my folder not delete a file :) Or am I understanding it wrong? :)Here is another extensive test with logs:
So we have one file in there. Let's edit it:
And here we have the old version of hello.txt :/
Or am I just using the commands all wrong?
atomtigerzoo commentedon Jul 19, 2018
Sorry, wrong button 😕
ncw commentedon Jul 20, 2018
Ah, I see what you mean - great demo! I think if you'd deleted hello.txt instead of giving it new content then rclone would have done what you expected.
So what is happening is that when rclone uploads a new hello.txt, b2 is creating a new version.
At no time does rclone issue a delete so
--b2-hard-deletedoesn't come into play.So I think the
--b2-hard-deleteflag is doing what it says, but not what you (and likely other users) expect.What do you think it should do? When rclone comes to update a file that already exists, do a hard delete on the existing file to stop b2 creating a new version? Maybe that should be a different flag
--b2-no-versions?I think the upload api always creates a new version so if we don't want to do that then we'll have to delete any existing file.
atomtigerzoo commentedon Jul 21, 2018
Ah ok, I got the docs at versioning wrong then. Sorry for that! I thought it means that also when uploading new or changed files, there won't be hidden ones and only one version.
I also found the info that if you set the lifecycle rules to "Keep Only Last Version" in the B2 docs means that it will stick around for one day: "This keeps only the most current version of a file. The previous version of the file is “hidden” for one day and then deleted."
Since I am planning to keep versions on my own, an option would be great to delete older versions or hidden files completely. Maybe with the option
--b2-no-versionsyou are suggesting.Thanks for the clarification and I hope to see that flag some day :)
dlong500 commentedon Aug 10, 2018
Would deleting changed files during a sync use additional B2 transactions? If so then it might be more cost effective to just let B2 expire the hidden files in a day rather than forcibly delete them.
ncw commentedon Aug 10, 2018
@dlong500 wrote:
deletes are free at b2. So rclone would have to know the ID of the existing file (which it should already) to delete it afterwards.
I think if it were me I'd stick with the delete after 1 day as that gives you 24 hours to recover stuff if stuff goes wrong.
ivandeex commentedon Feb 9, 2021
@atomtigerzoo @dlong500 This problem is reported against obsolete rclone version. Can you reproduce it with rclone 1.54?
ivandeex commentedon Mar 15, 2021
Closing answered questions
LinuxOnTheDesktop commentedon Dec 16, 2021
@ivandeex
I can, on rclone v1.57.0 - please see here on the Rclone forum.
EDITED.
LinuxOnTheDesktop commentedon Dec 18, 2021
Cf. #462 and #1547. The latter suggests that progress with rclone on this front got as far, only, as a beta.