<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rsyncshot/tests, branch main</title>
<subtitle>Time Machine–style rsync snapshots for Linux — hardlinked and space-cheap
</subtitle>
<id>https://git.cjennings.net/rsyncshot/atom?h=main</id>
<link rel='self' href='https://git.cjennings.net/rsyncshot/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/rsyncshot/'/>
<updated>2026-06-25T13:10:38+00:00</updated>
<entry>
<title>fix: graceful remote skip, quieter backups, accurate snapshot counts</title>
<updated>2026-06-25T13:10:38+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-06-25T13:10:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/rsyncshot/commit/?id=3ef8c7a0544f372f0d3c63c8055517e0c64347ec'/>
<id>urn:sha1:3ef8c7a0544f372f0d3c63c8055517e0c64347ec</id>
<content type='text'>
A scheduled backup to an unreachable remote now skips (exit 0) instead of erroring, so cron stops logging a failure when the NAS or laptop is offline. Authentication and host-key failures still error loudly, so a genuinely broken backup isn't masked as offline.

The actual backup drops rsync -v for --info=stats1, so the logfile gets a per-run summary instead of every transferred file path. The dryrun stays verbose.

list and status no longer count the latest/ working directory as a snapshot.

Snapshot directories are now read-only beyond the top level (find -type d). Only directories are touched, never the hard-linked files, so permissions don't ripple across snapshots.

Previously-unchecked rotation steps (orphan cleanup, the latest/ touch, the read-only chmod) now warn instead of failing silently. The remote snapshot listing falls back to BSD stat when GNU stat isn't available.
</content>
</entry>
<entry>
<title>feat: lock backups internally so cron needs no flock wrapper</title>
<updated>2026-06-25T05:37:41+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-06-25T05:37:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/rsyncshot/commit/?id=8f351ae4d14fc2abcc83716a192dfacff6dc65ef'/>
<id>urn:sha1:8f351ae4d14fc2abcc83716a192dfacff6dc65ef</id>
<content type='text'>
rsyncshot now acquires an exclusive, non-blocking lock (fd 200) before the backup phase, so a slow backup can't overlap the next cron tick. Only real backups lock. Help, list, status, and dryrun don't, so they're never blocked.

The lock file defaults to /run/lock/rsyncshot.lock, a root-only directory that avoids the symlink-truncation risk of a predictable name in world-writable /tmp. It falls back to /var/lock then /tmp, and is configurable via LOCKFILE. It's deliberately a different file from the old /tmp/rsyncshot.lock cron wrappers, so existing wrapped crontabs keep working until the wrapper is removed.

setup() no longer wraps cron entries in flock, since the script locks itself.
</content>
</entry>
<entry>
<title>fix: harden rsyncshot destination, rotation, and mount handling</title>
<updated>2026-06-25T05:07:31+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-06-25T05:07:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/rsyncshot/commit/?id=03a9ff353721ba8fb5f37cad2546d25788011451'/>
<id>urn:sha1:03a9ff353721ba8fb5f37cad2546d25788011451</id>
<content type='text'>
Refuse to run when REMOTE_PATH or MOUNTDIR is empty or non-absolute. A blank config value otherwise resolves the destination to the filesystem root, where rotation runs rm -rf and --delete.

Run the rotation cp/mv/rm as bare command names in remote mode, resolved by the remote PATH, instead of hardcoded /usr/bin paths that broke on remotes whose binaries live elsewhere. Resolve the real binary via command -v in local mode.

Pass rsync -R so each source is stored under its full path. Two includes sharing a basename (/usr/local/bin and /usr/bin) previously both mapped to latest/bin, and the second sync's --delete wiped the first. This changes the stored layout: /usr/local/bin now lives at latest/usr/local/bin instead of latest/bin. /home and /etc are unchanged.

Add rsync --numeric-ids so /etc and /home ownership survives a restore when the destination has a different passwd/group database.

Match mount points exactly via is_mounted() instead of a substring grep of /proc/mounts, so /media/backup no longer matches /media/backup2, paths compare literally, and mount points with spaces work.

Reject a retention count below 1, which previously still created one snapshot. Drop the grep "|| echo 0" that emitted a stray second line, assemble ssh options as arrays, and quote the RSYNC_RSH identity path.

Extract derive_paths() and is_mounted() as sourceable functions and add unit, rsync-flag, and gated remote-mode test suites. The suite now runs 36 tests, and shellcheck is clean across the script and tests.
</content>
</entry>
<entry>
<title>  Add SSH remote backup support, new commands, and test suite</title>
<updated>2026-01-29T18:18:12+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-01-29T18:18:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/rsyncshot/commit/?id=6836c4040a9f0170cec839c5b94cd8099b8465c6'/>
<id>urn:sha1:6836c4040a9f0170cec839c5b94cd8099b8465c6</id>
<content type='text'>
  - Add remote mode for SSH-based backups to servers like TrueNAS
  - Add SSH_IDENTITY_FILE config for non-root SSH keys
  - Add new commands: backup, status, list, dryrun
  - Add dependency checks for rsync, ssh, flock
  - Add timestamped logging
  - Fix: duplicate cron jobs on repeated setup
  - Fix: use mktemp for temp files
  - Fix: use portable sed instead of grep -oP
  - Fix: strengthen input validation with regex anchors
  - Fix: handle paths with spaces (newline-separated includes)
  - Change license from MIT to GPL v3
  - Add automated test suite (25 tests)
  - Update README with new features and testing docs
</content>
</entry>
</feed>
