### Install Timeshift using Meson Source: https://github.com/linuxmint/timeshift/blob/master/docs/development.md Installs the compiled Timeshift application to the system. Requires sudo privileges for system-wide installation. ```bash sudo meson install -C build ``` -------------------------------- ### Build Timeshift from Source Source: https://context7.com/linuxmint/timeshift/llms.txt Commands to install build dependencies, clone the Timeshift repository, and compile/install the application using Meson. Ensure all listed dependencies are installed before building. ```bash # Install build dependencies (Debian/Ubuntu) sudo apt install meson \ help2man \ gettext \ valac \ libvte-2.91-dev \ libgee-0.8-dev \ libjson-glib-dev \ libxapp-dev # Clone and build git clone https://github.com/linuxmint/timeshift.git cd timeshift meson setup build meson compile -C build # Install system-wide sudo meson install -C build ``` -------------------------------- ### Build Timeshift using Meson Source: https://github.com/linuxmint/timeshift/blob/master/docs/development.md Sets up the build environment using Meson and then compiles the Timeshift project. Ensure dependencies are installed first. ```bash meson setup build meson compile -C build ``` -------------------------------- ### Install Timeshift on ALT Linux Source: https://github.com/linuxmint/timeshift/blob/master/README.md Installs Timeshift on ALT Linux using apt-get with root privileges. ```shell su - apt-get update apt-get install timeshift ``` -------------------------------- ### Timeshift Cron Integration Examples Source: https://context7.com/linuxmint/timeshift/llms.txt Examples of cron job entries for automated Timeshift snapshots. Includes hourly, boot, and custom daily schedules. Ensure the path to the timeshift executable is correct. ```bash # Hourly check script installed at /etc/cron.d/timeshift-hourly # Contents: 0 * * * * root timeshift --check --scripted # Boot snapshot script installed at /etc/cron.d/timeshift-boot # Contents: @reboot root sleep 10m && timeshift --create --scripted --tags B # Manual cron entry example for custom schedule # Run daily at 2 AM 0 2 * * * root /usr/bin/timeshift --create --scripted --tags D >> /var/log/timeshift-cron.log 2>&1 ``` -------------------------------- ### Install Timeshift on Debian/Ubuntu Source: https://github.com/linuxmint/timeshift/blob/master/README.md Installs Timeshift on Debian-based systems using apt-get. Ensure your package list is updated before installation. ```shell sudo apt-get update sudo apt-get install timeshift ``` -------------------------------- ### Install Timeshift on Arch Linux Source: https://github.com/linuxmint/timeshift/blob/master/README.md Installs Timeshift on Arch Linux using pacman. ```shell sudo pacman -S timeshift ``` -------------------------------- ### Install Timeshift on Fedora Source: https://github.com/linuxmint/timeshift/blob/master/README.md Installs Timeshift on Fedora using dnf. Note that BTRFS snapshot support is limited to Ubuntu-specific layouts. ```shell sudo dnf update sudo dnf install timeshift ``` -------------------------------- ### Timeshift Snapshot Tagging Source: https://context7.com/linuxmint/timeshift/llms.txt Examples of creating snapshots with specific tags (D for Daily, W for Weekly) and comments. Boot snapshots (B) are automatically created when schedule_boot is enabled. ```bash # Available snapshot tags: # O - OnDemand (manually created) # B - Boot (created at system startup) # H - Hourly # D - Daily # W - Weekly # M - Monthly # Create snapshot with daily tag sudo timeshift --create --tags D --comments "Daily backup" # Create snapshot with multiple tags (counts toward both retention limits) sudo timeshift --create --tags "D,W" --comments "Combined daily/weekly" # Boot snapshots are auto-created when schedule_boot is enabled # They use a 10-minute startup delay to avoid impacting boot time ``` -------------------------------- ### Install Timeshift Dependencies on Debian-based Systems Source: https://github.com/linuxmint/timeshift/blob/master/docs/development.md Installs all required development dependencies for Timeshift using apt. Ensure you have sudo privileges. ```bash sudo apt install meson \ help2man \ gettext \ valac \ libvte-2.91-dev \ libgee-0.8-dev \ libjson-glib-dev \ libxapp-dev ``` -------------------------------- ### Create System Snapshots Source: https://context7.com/linuxmint/timeshift/llms.txt Generate new snapshots with support for custom comments, tags, and non-interactive execution. ```bash # Create an on-demand snapshot immediately sudo timeshift --create # Create snapshot with a description sudo timeshift --create --comments "Before system upgrade" # Create snapshot with specific tags (O=OnDemand, B=Boot, H=Hourly, D=Daily, W=Weekly, M=Monthly) sudo timeshift --create --tags D # Create snapshot with multiple tags sudo timeshift --create --tags "D,W" --comments "Weekly backup after kernel update" # Create snapshot in scripted/non-interactive mode sudo timeshift --create --scripted # Create snapshot and auto-confirm prompts sudo timeshift --create --yes ``` -------------------------------- ### Restore System Snapshots Source: https://context7.com/linuxmint/timeshift/llms.txt Revert the system to a previous state, with options for target device selection and bootloader management. ```bash # Interactive restore (prompts for all options) sudo timeshift --restore # Restore specific snapshot sudo timeshift --restore --snapshot '2024-10-12_16-29-08' # Restore to a specific target device sudo timeshift --restore --snapshot '2024-10-12_16-29-08' --target /dev/sda1 # Restore with GRUB2 reinstallation on specific device sudo timeshift --restore --snapshot '2024-10-12_16-29-08' --target /dev/sda1 --grub /dev/sda # Restore without reinstalling GRUB2 sudo timeshift --restore --snapshot '2024-10-12_16-29-08' --skip-grub # Non-interactive restore with auto-confirmation sudo timeshift --restore --snapshot '2024-10-12_16-29-08' --target /dev/sda1 --yes # Fully scripted restore sudo timeshift --restore --snapshot '2024-10-12_16-29-08' --target /dev/sda1 --grub /dev/sda --scripted ``` -------------------------------- ### List Snapshots via CLI Source: https://context7.com/linuxmint/timeshift/llms.txt Display available snapshots on the backup device, optionally filtering by device or UUID. ```bash # List all snapshots sudo timeshift --list # List snapshots on a specific device sudo timeshift --list --snapshot-device /dev/sda1 # List snapshots using device UUID sudo timeshift --list --snapshot-device UUID=abc123-def456 ``` -------------------------------- ### List Available Storage Devices Source: https://context7.com/linuxmint/timeshift/llms.txt Identify devices with Linux filesystems suitable for storing snapshots. ```bash # List all available devices with Linux filesystems sudo timeshift --list-devices ``` -------------------------------- ### Configure Snapshot Modes Source: https://context7.com/linuxmint/timeshift/llms.txt Toggle between RSYNC and BTRFS modes for snapshot operations. ```bash # Use BTRFS mode (for systems with @ and @home subvolumes) sudo timeshift --create --btrfs # Use RSYNC mode (works on all Linux filesystems) sudo timeshift --create --rsync # List snapshots in BTRFS mode sudo timeshift --list --btrfs # Restore using specific mode sudo timeshift --restore --rsync --snapshot '2024-10-12_16-29-08' ``` -------------------------------- ### Navigate to Timeshift Directory Source: https://github.com/linuxmint/timeshift/blob/master/docs/development.md Changes the current directory to the cloned Timeshift repository folder. This is necessary before building. ```bash cd timeshift ``` -------------------------------- ### Debug and Verbose CLI Options Source: https://context7.com/linuxmint/timeshift/llms.txt Adjust output verbosity and access utility information. ```bash # Show detailed debug messages sudo timeshift --create --debug # Show verbose rsync output (default) sudo timeshift --create --verbose # Hide rsync output sudo timeshift --create --quiet # Display version information timeshift --version # Display help message timeshift --help ``` -------------------------------- ### BTRFS Subvolume Layout Check Source: https://context7.com/linuxmint/timeshift/llms.txt Bash commands to verify the BTRFS subvolume layout and set the default subvolume. Ensure your system uses @ (root) and @home subvolumes for Timeshift compatibility. ```bash # Check if root is on @ subvolume (outputs "OK" if correct) grep -E '^[^#].+/.+\s+btrfs' /etc/fstab | \ grep -oE 'subvol=[^,]+' | \ cut -d= -f2 | \ grep -qE '^/?@$' && \ echo 'OK' || \ echo 'Not OK' # Set default BTRFS subvolume to root (subvolid=5) MP="$(mktemp -d)" mount | awk '/on \/ type btrfs/{print $1}' | sudo xargs -I{} mount {} "$MP" && \ sudo btrfs subvolume set-default 5 "$MP"; \ sudo umount "$MP" ``` -------------------------------- ### Timeshift Configuration File Source: https://context7.com/linuxmint/timeshift/llms.txt The main configuration file for Timeshift, controlling backup devices, schedules, and exclusion filters. Ensure correct UUIDs and boolean values are used. ```json { "backup_device_uuid": "abc123-def456-789", "parent_device_uuid": "", "do_first_run": "false", "btrfs_mode": "false", "include_btrfs_home_for_backup": "false", "include_btrfs_home_for_restore": "false", "stop_cron_emails": "true", "schedule_monthly": "true", "schedule_weekly": "true", "schedule_daily": "true", "schedule_hourly": "false", "schedule_boot": "true", "count_monthly": "2", "count_weekly": "3", "count_daily": "5", "count_hourly": "6", "count_boot": "5", "snapshot_size": "0", "snapshot_count": "0", "date_format": "%Y-%m-%d %H:%M:%S", "exclude": [ "/home/user/Downloads/**", "/home/user/.cache/**", "+ /home/user/.config/**" ], "exclude-apps": [] } ``` -------------------------------- ### Check Scheduled Snapshots Source: https://context7.com/linuxmint/timeshift/llms.txt Verify if a scheduled snapshot is due and trigger creation if necessary. ```bash # Check and create snapshot if scheduled sudo timeshift --check # Check in scripted mode (for cron jobs) sudo timeshift --check --scripted ``` -------------------------------- ### Clone Timeshift Repository Source: https://github.com/linuxmint/timeshift/blob/master/docs/development.md Clones the Timeshift source code repository from GitHub. Use this command in your development environment. ```bash git clone git@github.com:linuxmint/timeshift.git ``` -------------------------------- ### Timeshift Backup Hook Script Source: https://context7.com/linuxmint/timeshift/llms.txt A bash script executed after each snapshot is created. It can be used to perform additional tasks, such as syncing data, and has access to the snapshot path via TS_SNAPSHOT_PATH. ```bash #!/bin/bash # /etc/timeshift/backup-hooks.d/01-notify-backup # Send notification after backup completes echo "Backup completed at $(date)" >> /var/log/timeshift-hooks.log echo "Snapshot path: $TS_SNAPSHOT_PATH" >> /var/log/timeshift-hooks.log # Example: sync additional data if [ -d "$TS_SNAPSHOT_PATH" ]; then rsync -av /boot/efi/ "$TS_SNAPSHOT_PATH/boot-efi-backup/" fi ``` -------------------------------- ### Timeshift Restore Hook Script Source: https://context7.com/linuxmint/timeshift/llms.txt A bash script that runs after a restore operation completes, before system reboot. Useful for post-restore customizations like fixing permissions or updating package caches. ```bash #!/bin/bash # /etc/timeshift/restore-hooks.d/01-fix-permissions # Fix permissions after restore # Restore correct permissions on sensitive directories chmod 700 /root chmod 755 /home/* # Regenerate machine-id if needed if [ ! -s /etc/machine-id ]; then systemd-machine-id-setup fi # Update package cache apt-get update || true ``` -------------------------------- ### Delete Snapshots Source: https://context7.com/linuxmint/timeshift/llms.txt Remove individual snapshots or clear all existing backups from the storage device. ```bash # Delete a specific snapshot (interactive selection) sudo timeshift --delete # Delete specific snapshot by name sudo timeshift --delete --snapshot '2024-10-12_16-29-08' # Delete all snapshots sudo timeshift --delete-all # Delete with auto-confirmation sudo timeshift --delete --snapshot '2024-10-12_16-29-08' --yes ``` -------------------------------- ### Check BTRFS Root Subvolume Source: https://github.com/linuxmint/timeshift/blob/master/README.md Verifies if the BTRFS root subvolume is set to '@' or '/@'. This script helps ensure the correct BTRFS layout for Timeshift compatibility. ```shell grep -E '^[^#].+/ +btrfs' /etc/fstab | grep -oE 'subvol=[^,]+' | cut -d= -f2 | grep -qE '^/?@$' && \ echo 'OK' || \ echo 'Not OK' ``` -------------------------------- ### Remove Timeshift (Debian/Ubuntu) Source: https://github.com/linuxmint/timeshift/blob/master/README.md Removes Timeshift from Debian-based systems using apt-get. ```shell sudo apt-get remove timeshift ``` -------------------------------- ### Remove Timeshift (ALT Linux) Source: https://github.com/linuxmint/timeshift/blob/master/README.md Removes Timeshift from ALT Linux using apt-get with root privileges. ```shell su - -c "apt-get remove timeshift" ``` -------------------------------- ### Timeshift Default Exclusions Source: https://context7.com/linuxmint/timeshift/llms.txt A list of system paths that Timeshift automatically excludes from snapshots. These are always excluded and cannot be overridden, preventing issues with volatile and temporary data. ```bash # Default excluded paths (always excluded): /dev/* /proc/* /sys/* /media/* /mnt/* /tmp/* /run/* /var/run/* /var/lock/* /var/lib/dhcpcd/* /var/lib/docker/* /var/lib/schroot/* /lost+found /timeshift/* /timeshift-btrfs/* /swapfile /snap/* ``` -------------------------------- ### Set Default BTRFS Subvolume Source: https://github.com/linuxmint/timeshift/blob/master/README.md Sets the default BTRFS subvolume to '/' (root). This is necessary for Timeshift to correctly manage snapshots on BTRFS filesystems. ```shell MP="$(mktemp -d)" mount | awk '/on / type btrfs/{print $1}' | sudo xargs -I{} mount {} "$MP" && \ sudo btrfs subvolume set-default 5 "$MP"; \ sudo umount "$MP" ``` -------------------------------- ### Remove Timeshift (Arch) Source: https://github.com/linuxmint/timeshift/blob/master/README.md Removes Timeshift from Arch Linux using pacman. ```shell sudo pacman -R timeshift ``` -------------------------------- ### Remove Timeshift (Fedora) Source: https://github.com/linuxmint/timeshift/blob/master/README.md Removes Timeshift from Fedora using dnf. ```shell sudo dnf remove timeshift ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.