Skip to content

[Feature Request] Support for Pre-snapshot Hooks (Command execution before backup) #503

@MarioGalindoQ

Description

@MarioGalindoQ

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
mario.galindo@galindoingenieria.com

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions