[Feature Request] Support for Pre-snapshot Hooks (Command execution before backup)
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 42/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- linux, shell
- Domain
- operating-systems
Research direction
Start by tracing Timeshift's configuration and scheduled snapshot flow through the point where the rsync or BTRFS process begins. Review how user-defined commands could run before either snapshot method, including the listed DKMS, initramfs, and GRUB commands. Done means the hook is configurable, executes before snapshots, and handles command success or failure clearly.
Written by the indexing model from the issue text.
Description
Title: [Feature Request] Support for Pre-snapshot Hooks (Command execution before backup)
Description:
As a user of a high-performance workstation (Debian-based with Dual NVIDIA GPUs), I recently experienced a critical failure that could be avoided with a new feature in Timeshift: Pre-snapshot Hooks.
The Problem:
In rolling or fast-updating distributions (like Debian Testing or even Point Releases), Kernel updates often occur in the background. If a scheduled Timeshift snapshot runs after a Kernel update but before the user reboots or manually syncs the NVIDIA DKMS modules, the resulting snapshot is "broken" upon restoration.
When restored, the system files are back to the snapshot state, but the initramfs and bootloader might be out of sync with the current hardware modules, leading to the dreaded "Black Screen" (failed X11/Wayland initialization).
Proposed Solution:
Implement a "Pre-snapshot Hook" option in the configuration. This would allow users to define a script or a list of commands to be executed immediately before the rsync/btrfs process begins.
For NVIDIA/DKMS users, this hook would allow running:
dkms autoinstall
update-initramfs -u
update-grub
Benefits:
Reliability: Ensures that every snapshot is "Snapshot-Worthy" and fully bootable.
Professional Use: Professional workstations (Engineering, AI, Rendering) using proprietary drivers would have a much higher success rate in disaster recovery.
Automation: Users wouldn't need to rely on external crontab workarounds (which is what I am currently forced to use to protect my "MGQ" Workstation).
Current Workaround:
I have implemented a manual cron job that runs 10 minutes before the scheduled Timeshift backup to sync the system integrity, but a native implementation within Timeshift would be much more robust and user-friendly.
Thank you for your incredible work on this essential tool.
Dr. Mario Galindo
[email protected]
- Dominant language
- Vala
- Stars
- 4.3k
- Forks
- 159
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from linuxmint/timeshift
-
Difficulty 1/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
Difficulty 3/5 1-2 days Newbie friendliness 57/100
-
timeshift --create hangs indefinitely at exit in infinite read() = 0 loop on aarch64 (Fedora 44 / Kernel 7.2.x)Possibly taken @ygerlach claimed this 1 day ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 28/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
All issues in linuxmint/timeshift
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
alienator88/Pearcleaner#610 ·
-
severity: high
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
luainkernel/lunatik#1868 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
angolardevops/delonix-runtime#812 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day