aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* docs: tweak README intro wordingHEADmainCraig Jennings2026-06-251-3/+3
|
* chore: stop tracking todo.orgCraig Jennings2026-06-251-0/+1
|
* fix: graceful remote skip, quieter backups, accurate snapshot countsCraig Jennings2026-06-254-12/+140
| | | | | | | | | | | | 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.
* docs: cover internal locking, relative-path layout, and the test suiteCraig Jennings2026-06-251-8/+31
|
* feat: lock backups internally so cron needs no flock wrapperCraig Jennings2026-06-254-9/+189
| | | | | | | | 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.
* fix: harden rsyncshot destination, rotation, and mount handlingCraig Jennings2026-06-2511-73/+558
| | | | | | | | | | | | | | | | 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.
* restructure: move docs/ to .ai/ + sync latest templateCraig Jennings2026-04-201-1/+1
| | | | | Per claude-templates c36fd14. Claude tooling moves to hidden .ai/; project-level docs/ reserved for real documentation.
* Treat rsync exit code 24 as non-fatalCraig Jennings2026-02-121-1/+6
| | | | | | Files vanishing during transfer (exit 24) is normal — temp files, editor swap files, etc. get cleaned up while the backup runs. Log a warning instead of aborting snapshot rotation.
* Fix snapshot rotation failure on remote filesystemsCraig Jennings2026-02-121-3/+22
| | | | | | | | | | | Snapshots with read-only permissions (from chmod -w at creation) and internal dirs with restrictive modes (e.g. /etc at 555) prevented rm -rf from deleting old snapshots during rotation. This caused cascading mv failures and silent rotation breakage. - Add chmod -R u+w before rm -rf of oldest snapshot - Clean up orphan snapshots beyond retention count - Add error checking on rm, mv, and cp -al operations
* Add .gitignore and increase rsync I/O timeout to 10 minutesCraig Jennings2026-02-072-2/+4
| | | | | Add .gitignore for docs/ and inbox/. Increase rsync --timeout from 300s to 600s for slower connections.
* Add 5-minute I/O timeout to rsync transfersCraig Jennings2026-02-041-2/+2
| | | | | | | | Adds --timeout=300 to rsync commands to handle network interruptions gracefully, especially over WiFi. Without this, SSH connection drops could leave rsync hanging indefinitely. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Corrected LICENSE to BSD-3 Clause LicenseCraig Jennings2026-01-292-675/+30
|
* Add Development section to README with Makefile targetsCraig Jennings2026-01-291-5/+23
| | | | | | - Add make deps to Quick Start instructions - Add Development section with all make targets table - Move Testing as subsection under Development
* Add test support and fix command alias usageCraig Jennings2026-01-291-3/+3
| | | | | | - Make INSTALLHOME, SCRIPTLOC, LOGFILE overridable via env vars - Add RSYNCSHOT_SKIP_MOUNT_CHECK for testing without mount points - Use CP, MV, RM variables in run_cmd to avoid shell alias issues
* Add test, lint, and deps targets to MakefileCraig Jennings2026-01-291-1/+55
| | | | | | | | | - Add help target showing all available commands - Add test targets: test, test-quick, test-verbose - Add lint target for shellcheck static analysis - Add check target combining lint and test - Add deps target with cross-platform package manager support (apt, dnf, yum, pacman, zypper, apk, brew)
* Add SSH remote backup support, new commands, and test suiteCraig Jennings2026-01-2910-212/+2925
| | | | | | | | | | | | | | | | - 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
* improving comments, updating author emailCraig Jennings2024-05-061-11/+15
|
* removing advice :)Craig Jennings2022-10-241-1/+0
|
* latest ideas/updatesCraig Jennings2022-10-241-25/+23
|
* removing literate file; editing source directlyCraig Jennings2022-10-241-208/+0
|
* not removing rsyncshot.log on uninstallCraig Jennings2022-10-241-1/+1
|
* fixed mounting if unmounted; corrected linting issuesCraig Jennings2022-10-241-88/+76
|
* added Makefile. added comments about installing/uninstallingCraig Jennings2022-10-112-2/+14
|
* adding MakefileCraig Jennings2022-10-111-0/+9
|
* quote so flock -c sees the command as one argumentCraig Jennings2022-08-051-14/+6
|
* updated the readme to reflect flock + lock file usageCraig Jennings2021-08-151-1/+3
|
* added flock check to literate source and regeneratedCraig Jennings2021-08-152-6/+34
|
* add flock to present overlapping rsyncshot runsCraig Jennings2021-08-151-26/+6
|
* fixed setup textCraig Jennings2021-04-051-1/+1
|
* fixed setup textCraig Jennings2021-04-051-2/+2
|
* better listsCraig Jennings2021-04-041-4/+4
|
* better listsCraig Jennings2021-04-041-0/+4
|
* fixed typo.Craig Jennings2021-04-041-1/+1
|
* typo fixed.Craig Jennings2021-04-041-1/+1
|
* Major README.org updateCraig Jennings2021-04-041-1/+54
|
* separate hostnames, avoid alias conflicts, and many related changes.Craig Jennings2021-04-042-74/+134
| | | | | | | | - printf instead of echo - make script executable after install - make TYPE case insensitive earlier for HELP - validate destination directory exists - validate destination is a mounted drive, if not attempt a mount.
* Added properties to insert comments.Craig Jennings2021-04-042-68/+93
|
* Made rsyncshot "literate" (rsyncshot.org).Craig Jennings2021-04-042-32/+199
| | | | Comments coming back in once I get org properties working as expected.
* adding bugs/features in todo.orgCraig Jennings2021-04-011-1/+1
|
* Update LICENSECraig Jennings2020-11-231-674/+21
|
* squash! updating README.orgCraig Jennings2020-11-221-1/+1
|
* updating README.orgCraig Jennings2020-11-221-4/+2
|
* readme.org updatedCraig Jennings2020-11-222-7/+1
|
* Initial commitCraig Jennings2020-11-033-1/+165
|
* Initial commitCraig Jennings2020-11-032-0/+675