== 1 sun accuracy 2026-06-21 Sunset 21:21. PASS 1 greenwich solstice 21:21 BST 2026-03-20 Sunset 18:11. PASS 1 equator equinox 18:11 UTC 2026-10-13 Sunset 18:16. 2026-10-14 Sunset 18:14. 2026-10-15 Sunset 18:12. PASS 1 berlin three days == 2 polar latitude 2026-06-21 No sunset. 2026-12-21 No sunset. PASS 2 tromso solstices 2026-10-14 No sunset. PASS 2 today has no sunset at 89.9 No sunset. Snapshot 02:00. 59 files. PASS 2 polar snap line PASS 2 polar folder name PASS 2 tick later the same day: silent, exit 0, nothing new == 3 real end to end Sunset 16:14. Snapshot 02:01. 59 files. find -type f: 59, folder: 2026-10-14T02-01 PASS 3 at least 50 files PASS 3 printed count equals find -type f PASS 3 FIFO absent PASS 3 symlink kept with its target Only in /tmp/sq/backup/2026-10-14T02-01: SUNSET.sha256 Only in /tmp/sq/docs: pipe PASS 3 diff -r: only the manifest and the FIFO Register of /tmp/sq/docs. Latitude 52.52. Longitude 13.40. 2026-10-14 Sunset 16:14. Snapshot 02:01. 59 files. PASS 3 log: heading and one dated line Sunset 16:14. Snapshot 02:02. 59 files. PASS 3 second snap: one more line, no second heading PASS 5 sha256sum -c in a clean snapshot == 4 link rule and read-only Sunset 16:14. Snapshot 02:02. 60 files. Sunset 16:14. Snapshot 02:03. 60 files. base64mime.py 2115285 2115285 charset.py 2115286 2115257 same-size.txt 2115300 2115260 errors.py 2115289 2115258 PASS 4 untouched file: same inode PASS 4 edited file: new inode PASS 4 first snapshot keeps the original bytes PASS 4 same size, new mtime: copied PASS 4 chmod +x with mtime unchanged: copied, stored with x PASS 4 no regular file in a snapshot has a write bit == 5 restore test Sunset 16:14. Snapshot 02:03. 59 files. Restored 2026-10-14T02-03. 59 of 59 files match. (exit 0) PASS 5 verify: N of N, exit 0 PASS 5 scratch folders gone Another run is in progress. (exit 1) PASS 5 lock held: exit 1 Differs: charset.py Restored 2026-10-14T02-03. 58 of 59 files match. (exit 1) PASS 5 flipped byte named, N-1 of N, exit 1 == 6 tick logic (unit tests, injected clock) test_at_sunset_minute (test_sunset.Tick.test_at_sunset_minute) ... ok test_before_and_after_sunset (test_sunset.Tick.test_before_and_after_sunset) ... ok test_lock_held_by_tick_is_silent (test_sunset.Tick.test_lock_held_by_tick_is_silent) ... ok test_missed_days (test_sunset.Tick.test_missed_days) ... ok test_morning_snap_does_not_block_evening (test_sunset.Tick.test_morning_snap_does_not_block_evening) ... ok test_no_sunset_snapshot_at_midnight_then_tick_silent (test_sunset.Polar.test_no_sunset_snapshot_at_midnight_then_tick_silent) ... ok test_permission_denied (test_sunset.Snapshot.test_permission_denied) ... ok test_failed_day_then_success (test_sunset.Snapshot.test_failed_day_then_success) ... ok ---------------------------------------------------------------------- Ran 8 tests in 0.061s OK PASS 6 tick unit tests == 7 atomic commit and refusals after SIGKILL: .lock .partial-2026-10-14T02-03 PASS 7 SIGKILL: no final folder, a .partial left Sunset 16:14. Snapshot 02:03. 20000 files. PASS 7 next snap removes the .partial and succeeds Destination is inside the source. Nothing was copied. (exit 1) PASS 7 destination inside the source Source is inside the destination. Nothing was copied. (exit 1) PASS 7 source inside the destination Latitude must be between -90 and 90. (exit 2) PASS 7 --lat 91 Destination does not exist. Nothing was copied. (exit 1) PASS 7 destination does not exist PASS 7 missing destination still absent Destination has no register. Nothing was copied. (exit 1) PASS 7 tick into an empty folder PASS 7 that refusal is on stderr Register is for /tmp/sq/docs. Nothing was copied. (exit 1) PASS 7 snap into another source's register Register is for /tmp/sq/docs. Nothing was copied. (exit 1) PASS 7 tick into another source's register Sunset 16:14. No snapshot. No such file or directory. (exit 1) PASS 7 a vanished source is a plain failure line, exit 1 PASS 7 that failure is appended, dated, to its own register Destination cannot hard link. Nothing was copied. (exit 1) PASS 7 FAT destination cannot hard link == 8 scheduler unit # sunset-snapshot.service [Unit] Description=Daily copy of one folder. Hour set by the sun. [Service] Type=oneshot ExecStart="/usr/bin/python3.12" "/tmp/sq/tool/sunset.py" "tick" "--src" "/tmp/sq/docs" "--dest" "/tmp/sq/backup" "--lat" "52.52" "--lon" "13.4" # sunset-snapshot.timer [Unit] Description=Daily copy of one folder. Hour set by the sun. [Timer] OnCalendar=*:0/15 Persistent=true OnStartupSec=1min [Install] WantedBy=timers.target PASS 8 service carries the Description PASS 8 timer carries the Description PASS 8 timer Persistent=true PASS 8 timer OnCalendar=*:0/15 systemd-analyze verify: exit 0 (no output) PASS 8 systemd-analyze verify passes PASS 8 install --print wrote nothing == 9 terminal look in tmux 80x24 $ uv run sunset.py --help Takes a copy of one folder each evening, when the sun sets where you are. Unchanged files are linked, not copied. Nothing is ever deleted. usage: sunset.py COMMAND [options] commands: when print the sunset: --lat --lon [--date YYYY-MM-DD] [--days N] snap take one snapshot now, at any hour tick what the scheduler runs every 15 minutes verify check a snapshot by restoring it: --dest [--snapshot NAME] install write and load the scheduler unit (--print writes nothing) uninstall unload and delete the unit that install wrote snap, tick and install take: --src DIR the folder to copy --dest DIR an existing folder that holds the snapshots and sunset.log --lat DEG latitude, -90 to 90, north positive --lon DEG longitude, -180 to 180, east positive Times are in this machine's zone, for a flat horizon at sea level. normal is dead $ PASS 9 --help in the pane: command, every line, prompt, nothing scrolled PASS 9 last --help line is normal is dead PASS 9 no line over 80 columns PASS 9 no ESC byte in --help or snap output PASS 9 --help is at most 22 lines, so the command and the prompt fit in 24 == 10 house rules (grep found nothing) PASS 10 no stylistic dash PASS 10 no emoji or pictograph in any text file links: lo Ran 35 tests in 2.451s OK PASS 10 unit tests pass with the network off == passed 56 of 56