How to specify file-include regex in synchronizer

Đang mở
#536 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
35/100
Loại issue
Tài liệu
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
cloud

Hướng nghiên cứu

Start from the reporter's snippet: it imports SyncPolicyManager but constructs ScanPoliciesManager, and passes exclude_file_regexes=".", which matches every file. Reproduce with a folder holding file1.dat, file2.dat and file3.dat in dry-run mode, then check how include and exclude regexes combine in the sync policy code. Done when a documented or fixed pattern uploads only file1.dat and the example in the docs runs as written.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

I've been trying to solve a simple problem, how to specify to only upload filefile1.dat
I have these files in the folder: file1.dat file2.dat file3.dat

I've tried with many different regex'es for the parameter include_file_regexes but not succeed to include on this file.

from b2sdk.v2 import SyncPolicyManager
from b2sdk.v2 import parse_folder
from b2sdk.v2 import Synchronizer
from b2sdk.v2 import SyncReport
import time, sys

source = (r"c:\temp\test")
destination = "b2://" + AccountInfos["bucketName"]
source = parse_folder(source, b2api)
destination = parse_folder(destination, b2api)

policies_manager = ScanPoliciesManager(exclude_file_regexes=".", include_file_regexes=r"file1\.dat")
synchronizer = Synchronizer(max_workers=10, policies_manager=policies_manager, dry_run=True, allow_empty_source=True)
no_progress = False

with SyncReport(sys.stdout, no_progress) as reporter:
        synchronizer.sync_folders(
            source_folder=source,
            dest_folder=destination,
            now_millis=int(round(time.time() * 1000)),
            reporter=reporter,
        )
Ngôn ngữ chính
Python
Star
214
Fork
68
Merge trung bình
51 phút
Pull request đã merge (30 ngày)
6

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Backblaze/b2-sdk-python

Tất cả issue của Backblaze/b2-sdk-python

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.