<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rsyncshot/tests/cases/test_locking.sh, 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-25T05:37:41+00:00</updated>
<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>
</feed>
