惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Apple Machine Learning Research
Apple Machine Learning Research
Recent Announcements
Recent Announcements
IT之家
IT之家
人人都是产品经理
人人都是产品经理
G
Google Developers Blog
Microsoft Azure Blog
Microsoft Azure Blog
博客园_首页
大猫的无限游戏
大猫的无限游戏
U
Unit 42
罗磊的独立博客
博客园 - Franky
WordPress大学
WordPress大学
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
M
MIT News - Artificial intelligence
SecWiki News
SecWiki News
V
Vulnerabilities – Threatpost
P
Privacy International News Feed
P
Palo Alto Networks Blog
F
Fortinet All Blogs
P
Proofpoint News Feed
博客园 - 叶小钗
C
CERT Recently Published Vulnerability Notes
T
Tor Project blog
Spread Privacy
Spread Privacy
S
Securelist
C
Cisco Blogs
I
Intezer
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Cyberwarzone
Cyberwarzone
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
P
Privacy & Cybersecurity Law Blog
宝玉的分享
宝玉的分享
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Engineering at Meta
Engineering at Meta
S
Schneier on Security
C
CXSECURITY Database RSS Feed - CXSecurity.com
GbyAI
GbyAI
T
Troy Hunt's Blog
T
Threatpost
博客园 - 司徒正美
Y
Y Combinator Blog
Hugging Face - Blog
Hugging Face - Blog
AWS News Blog
AWS News Blog
T
The Blog of Author Tim Ferriss
G
GRAHAM CLULEY
N
Netflix TechBlog - Medium
酷 壳 – CoolShell
酷 壳 – CoolShell
Google DeepMind News
Google DeepMind News
Know Your Adversary
Know Your Adversary
S
SegmentFault 最新的问题

alexwlchan’s notes

A single command to test all my changed Go packages Disable the new message animations in WhatsApp Always-on SSH agent forwarding with my Git pushes Managing the caption of a photo with AppleScript (but not PhotoKit) Goodhart’s and Campbell’s Law are different Notes from The Cornishman No. 176 (Spring 2026) Notes from The Cornishman No. 176 (Spring 2026) GitUp can’t diff text files larger than 8MB Home Testing the width of a page on a mobile device using Playwright Disable AirPods charging notifications Start a Caddy server in a subprocess during a Python session Filter a list of JSON object based on a list of tags HOME_GET_ME_HOME is a Citymapper Shortcuts action The FileExistsError exception exposes a filename attribute The red-lined bubble snail Why can’t Python connect to example.com? Useful type hints for Python How to truncate the middle of long command output AirPlay Receiver can interfere with Flask apps What’s the main prefix in SQLite queries? The file(1) command can read SQLite databases My randline project is tested by Crater Drawing an image with Liquid Glass using SwiftUI Previews Road signs in the Soviet union don’t have circular heads Setting up golink in my personal tailnet Create a file atomically in Go Get a map of IP addresses for devices in my tailnet The SQLite command line shell will count your unclosed parentheses Use SQL triggers to prevent overwriting a value Testing date formatting with date-fns-tz and different timezones The “strangler” pattern is named after a tree, not an act of violence Place with the same name, but different etymology
Finding high-churn folders that bother Backblaze
2026-07-08 · via alexwlchan’s notes

I looked at log files in bzreports_lastfilestransmitted to work out which folders were generating new content.

I just got back to my personal computer after a day of work. My Mac has been switched on all day, doing very little. After a few minutes of idle web browsing, I noticed that bztransmit was using 100% of a CPU core, which I found confusing.

bztransmit is the background process that uploads files to Backblaze, my offsite backup provider. When I checked the Backblaze preferences, it claimed I had 169MB of remaining files. How?!

Nothing I’d done in the last few minutes would generate that much new content, and my Mac had been running all day; ample time to upload anything I created this morning or earlier. (Even then, 169MB feels like a lot – most of my work is in text, which is very light on storage.)

I wanted to see exactly what Backblaze was uploading, and this Reddit post by Brian Wilson (Backblaze co-founder) was helpful:

How can I find which files Backblaze is currently uploading? […]

You can watch the logs in this location on your Mac: /Library​/Backblaze.bzpkg​/bzdata​/bzlogs​/bzreports_lastfilestransmitted​/<day_of_week>.log If you watch lines getting appended to those files, make your editor REALLY WIDE to see them super nicely formatted, they report the exact files being transmitted in real time to the Backblaze datacenter, plus a measurement of how fast they were transmitted.

I found the folder he was describing, and the most recently edited file was called 07.log. (Perhaps it’s day of the month, rather than day of the week?)

The log contains a lot of information about the files being uploaded, but I was really only interested in the paths. I wanted to see which folders were causing so many uploads. I wrote a short Python script to search for all the paths in the file, truncate them to a certain depth, and print the most commonly-uploaded folders:

#!/usr/bin/env python3

from collections import Counter
import os
from pathlib import Path
import re
import sys


# PATH_RE is a regex that finds strings that look like paths in
# my home directory.
PATH_RE = re.compile(os.environ["HOME"] + r"/[A-Za-z0-9\.\-/_]+")


if __name__ == "__main__":
    try:
        log_path = sys.argv[1]
        max_depth = int(sys.argv[2])
    except (IndexError, ValueError):
        sys.exit(f"Usage: {__file__} LOG_PATH MAX_DEPTH")

    # Find all the paths in the Backblaze log file
    with open(log_path) as in_file:
        paths = [Path(m.group(0)) for m in PATH_RE.finditer(in_file.read())]

    # Truncate all the paths to as deep as specified by the `max_depth` argument
    folders = [p.parent for p in paths]
    truncated_paths = [Path(*p.parts[:max_depth]) for p in folders]

    # Print the paths, from most to least common
    for path, count in Counter(truncated_paths).most_common():
        print(f"{count:5d}\t{path}")

The script takes two arguments: the path to the log file, and the depth at which to truncate the folders.

I ran the script, which quickly showed one folder being uploaded far more than the rest:

$ python3 find_backblaze.py /Library​/Backblaze.bzpkg​/bzdata​/bzlogs​/bzreports_lastfilestransmitted​/07.log 6 | head -n 5
 2292	/Users/alexwlchan/Library/Containers/com.apple.Safari
  997	/Users/alexwlchan/Library
  321	/Users/alexwlchan/Library/Preferences
  267	/Users/alexwlchan/Pictures
  116	/Users/alexwlchan/Library/Photos/Libraries

I don’t know exactly what’s in that com.apple.Safari container; a quick poke around shows some caches, some network data, some cookies. It looks like a big collection of tiny files that get created as I use my web browser, and Backblaze is getting overwhelmed trying to upload them all.

I doubt I’ll ever want to restore anything from that folder, so I’ve excluded it from Backblaze. Almost immediately, my remaining files dropped to zero and bztransmit calmed down.

There are probably other high-churn folders that give Backblaze a headache, so I expect I may run this script again soon.