Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backblaze B2 remote does not always honor --dry-run or --interactive flags #8194

Open
metadaddy opened this issue Nov 19, 2024 · 0 comments
Open

Comments

@metadaddy
Copy link
Contributor

metadaddy commented Nov 19, 2024

What is the problem you are having with rclone?

The Backblaze B2 remote does not honor the --dry-run or --interactive flags in backend operations.

What is your rclone version (output from rclone version)

% rclone version
rclone v1.68.2
- os/version: darwin 14.7.1 (64 bit)
- os/kernel: 23.6.0 (arm64)
- os/type: darwin
- os/arch: arm64 (ARMv8 compatible)
- go/version: go1.23.3
- go/linking: dynamic
- go/tags: cmount

Which OS you are using and how many bits (e.g. Windows 7, 64 bit)

macOS Sonoma 14.7.1

Which cloud storage system are you using? (e.g. Google Drive)

Backblaze B2

The command you were trying to run (e.g. rclone copy /tmp remote:tmp)

rclone backend cleanup-hidden b2:metadaddy-rclone --dry-run

A log from the command with the -vv flag (e.g. output from rclone -vv copy /tmp remote:tmp)

First, create some hidden versions...

% rclone copyto -I /Users/ppatterson/Documents/Test\ Files/hello.txt b2:metadaddy-rclone/test-dry-run.txt
% rclone copyto -I /Users/ppatterson/Documents/Test\ Files/hello.txt b2:metadaddy-rclone/test-dry-run.txt
% rclone copyto -I /Users/ppatterson/Documents/Test\ Files/hello.txt b2:metadaddy-rclone/test-dry-run.txt
% rclone --b2-versions ls b2:metadaddy-rclone       
       14 test-dry-run.txt
       14 test-dry-run-v2024-11-19-014429-131.txt
       14 test-dry-run-v2024-11-19-014219-013.txt

Now run cleanup-hidden with --dry-run:

% rclone backend cleanup-hidden b2:metadaddy-rclone --dry-run -vv                                  
2024/11/18 17:42:32 DEBUG : Setting --fast-list "true" from environment variable RCLONE_FAST_LIST="true"
2024/11/18 17:42:32 DEBUG : rclone: Version "v1.68.2" starting with parameters ["rclone" "backend" "cleanup-hidden" "b2:metadaddy-rclone" "--dry-run" "-vv"]
2024/11/18 17:42:32 DEBUG : Using config file from "/Users/ppatterson/.config/rclone/rclone.conf"
2024/11/18 17:42:32 INFO  : B2 bucket metadaddy-rclone: cleaning bucket "metadaddy-rclone" of all hidden files
2024/11/18 17:42:32 DEBUG : test-dry-run.txt: Not deleting current version (id "4_z91a5cf5973f5dc4f848d0c1b_f10733d4f99d18f52_d20241119_m014219_c004_v0402027_t0044_u01731980539013") "upload" dated 2024-11-18 17:42:19.013 -0800 PST (13.651871s ago)
2024/11/18 17:42:32 DEBUG : test-dry-run.txt: Deleting (id "4_z91a5cf5973f5dc4f848d0c1b_f118ed7238ae3ae95_d20241119_m014215_c004_v0402026_t0034_u01731980535576")
2024/11/18 17:42:32 DEBUG : test-dry-run.txt: Deleting (id "4_z91a5cf5973f5dc4f848d0c1b_f1175cd5b88012b9d_d20241119_m014212_c004_v0402007_t0007_u01731980532933")
2024/11/18 17:42:32 DEBUG : 11 go routines active

Old versions are gone!

% rclone --b2-versions ls b2:metadaddy-rclone                    
       14 test-dry-run.txt

Looking at the code, operations.SkipDestructive() is not called at all in b2.go.

I'll see if I can spin up a quick PR - it looks like it's just a case of adding operations.SkipDestructive() and the associated logic in the relevant places.

How to use GitHub

  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.
@metadaddy metadaddy changed the title Backblaze B2 remote does not honor --dry-run or --interactive flags Backblaze B2 remote does not always honor --dry-run or --interactive flags Nov 19, 2024
metadaddy added a commit to metadaddy/rclone that referenced this issue Nov 19, 2024
metadaddy added a commit to metadaddy/rclone that referenced this issue Nov 19, 2024
metadaddy added a commit to metadaddy/rclone that referenced this issue Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant