gitea-backup-pull: switch vlda-01 retention from a fixed count to a 30-day rotation
KEEP=30 (last 30 archives) approximated 30 days only if there was exactly one dump per day. Prune by file mtime instead (find -mtime +30) so a catch-up burst after time offline doesn't prematurely evict recent dumps, and a quiet stretch doesn't hoard month-old ones.
This commit is contained in:
@@ -39,7 +39,7 @@ of every script here, so it's worth stating plainly before anything else:
|
||||
|
||||
| File here | Deployed path | Purpose |
|
||||
|---|---|---|
|
||||
| `user-scripts/gitea-backup-pull/script` | `/boot/config/plugins/user.scripts/scripts/gitea-backup-pull/script` | Pulls new `gitea-dump` archives from `alpha` via the restricted `giteabackup` SFTP account, verifies each one's sha256 checksum, deletes both files on `alpha` only after a confirmed match, prunes its own local retention (30). Resolves and mounts the `WSD2L840` Unassigned Device itself first, and unmounts it again afterward — but only if this run is the one that mounted it, never disturbing a mount it found already in place, and only if nothing else is using the disk at that moment (checked via `fuser -m`; `rc.unassigned umount`'s own lazy unmount never refuses on its own, so this script checks first and just leaves it mounted, no error, if something else is still on it). See the script's own header comment for the full reasoning. |
|
||||
| `user-scripts/gitea-backup-pull/script` | `/boot/config/plugins/user.scripts/scripts/gitea-backup-pull/script` | Pulls new `gitea-dump` archives from `alpha` via the restricted `giteabackup` SFTP account, verifies each one's sha256 checksum, deletes both files on `alpha` only after a confirmed match, prunes its own local retention (rolling 30 calendar days, by file `mtime` - not a fixed count). Resolves and mounts the `WSD2L840` Unassigned Device itself first, and unmounts it again afterward — but only if this run is the one that mounted it, never disturbing a mount it found already in place, and only if nothing else is using the disk at that moment (checked via `fuser -m`; `rc.unassigned umount`'s own lazy unmount never refuses on its own, so this script checks first and just leaves it mounted, no error, if something else is still on it). See the script's own header comment for the full reasoning. |
|
||||
| `user-scripts/gitea-backup-pull/description` | `.../gitea-backup-pull/description` | Shown in the User Scripts UI. |
|
||||
| `user-scripts/gitea-backup-pull-onboot/script` | `.../gitea-backup-pull-onboot/script` | One-line wrapper: `bash`-invokes the script above. Exists only because `schedule.json` supports one schedule per script *path* — this is how the "also run once at every restart" requirement was added alongside the existing daily `03:30` schedule without disturbing it. |
|
||||
| `user-scripts/gitea-backup-pull-onboot/description` | `.../gitea-backup-pull-onboot/description` | Shown in the User Scripts UI. |
|
||||
|
||||
Reference in New Issue
Block a user