Ubunatic Coding

Make Linux cache flushing observable

psync makes sync progress visible.

The standard sync command blocks until dirty pages are written without showing what remains. Psync polls Linux write-back counters while sync runs, reports elapsed time and a summary, and can watch a scoped target and resync when its files change.

go install codeberg.org/ubunatic/psync@latest

Observe the flush while it runs

Psync starts sync(1) in the background and polls Dirty and Writeback in /proc/meminfo. It prints live progress and a completion summary without changing sync's behavior. Linux per-device write rates and in-flight requests are available when a target mount or device is selected.

psync -f /mnt/secure
psync -w /mnt/secure
psync -F important-file.db

Progress, watch, and scoped follow mode

Sync with progress

Poll system dirty/write-back counters while sync runs and print a summary.

Passive watch

Watch system write-back state without starting sync; target mode also reports device I/O.

Follow changed files

Resync a specific file or directory after changes, with debounce and minimum-interval guards.

Select a mount

Choose a mounted filesystem interactively when follow or watch mode needs a target.

Choose what psync observes

Default
Run sync and show live dirty/write-back progress and a completion summary.
-d / --data
Pass data-only mode to sync(1), without unneeded metadata.
-f / --file-system
Sync the filesystem that contains the selected target files.
-w / --watch
Observe write-back progress without calling sync(1).
-F / --follow
Watch selected files or direct directory entries and resync on changes.
--debounce and --min-interval
Coalesce change bursts and enforce a minimum delay between follow-mode syncs.
-i / --interval
Set how often psync samples /proc/meminfo; the default is 500 ms.

Follow only a target you choose

Follow mode requires a scoped file, directory, or selected filesystem. It does not infer targets from system-wide Dirty counters, so unrelated writes from other processes cannot trigger extra sync cycles. Directory watching is non-recursive.

Use psync demo to watch a deterministic simulated flush without writing test data to disk.
psync demo
psync demo --size-mb 8192 --duration 20s

Install and try the simulation

Install from the latest Go module or download a release binary. Run psync demo to see the progress display without root access, a slow disk, or real disk writes.

go install codeberg.org/ubunatic/psync@latest
psync demo

Make Linux sync progress visible

Read the engineering story for the design of live write-back monitoring and scoped follow mode.

At a glance

Stack
Go 1.26.5, Cobra, Loom, Linux /proc (meminfo, diskstats, mountinfo), inotify, GoReleaser
Milestones
Follow mode and mount picker in the first release (#006, f792678) · Per-device progress in watch mode (#011, 9279f9c) · Loom mount picker and v0.2.2 release (#013, 4485b28, 460d911)
Commits
26