LinuxCommandLibrary

resticprofile-unschedule

Remove restic profile backup schedule

TLDR

Unschedule a backup for a specific profile

$ resticprofile unschedule [[-n|--name]] "[profile_name]"
copy

Unschedule all backups
$ resticprofile unschedule --all
copy

SYNOPSIS

resticprofile unschedule [--global] [--user] [--quiet|-q] [--verbose|-v] <profile-name>

PARAMETERS

<profile-name>
    The name of the resticprofile profile whose schedule should be removed. This name must correspond to an existing profile configuration.

--global
    (Optional) Unschedules the backup task system-wide (e.g., from root's crontab or systemd system units). Requires root privileges.

--user
    (Optional) Unschedules the backup task for the current user (e.g., from the user's crontab or systemd --user units). This is often the default if neither --global nor --user is specified, but explicit use ensures clarity.

--quiet, -q
    (Optional) Suppresses output messages, showing only errors.

--verbose, -v
    (Optional) Enables verbose output, providing more detailed information about the operation.

DESCRIPTION

The resticprofile-unschedule command is a subcommand of the resticprofile utility, designed to manage automated restic backups. Its primary function is to remove or disable previously configured backup schedules for a specific resticprofile profile. When resticprofile schedule is used, it typically creates entries in the system's scheduling mechanisms, such as cron jobs or systemd timers. The unschedule command reverses this action, deleting the relevant cron entries or disabling/removing the systemd unit files associated with the specified backup profile. This ensures that the automated backup for that profile will no longer run at its designated intervals, without affecting any existing backup data in the repository or the repository itself.

CAVEATS

  • Permissions: Unscheduling a system-wide (--global) task requires root privileges. User-specific tasks typically require only user privileges.
  • No Data Deletion: This command only removes the schedule; it does not delete any existing backup data or the restic repository itself.
  • Profile Existence: The command will fail if the specified <profile-name> does not correspond to a configured resticprofile.
  • Scheduler Dependency: Relies on cron or systemd being properly configured and running on the system for the original schedule to have been effective.

HOW IT WORKS

The resticprofile-unschedule command typically operates by either removing a specific line from the relevant crontab file (e.g., /etc/crontab for system-wide, or a user's crontab for user-specific) or by disabling and potentially deleting the systemd timer and service unit files (e.g., .timer and .service files) that were created to manage the scheduled backup. It identifies these entries based on the provided <profile-name>.

IMPACT ON BACKUP REPOSITORY

It is crucial to understand that running resticprofile-unschedule has no impact on the restic backup repository itself. All data previously backed up remains intact and accessible. The command solely affects the automation of future backups for the specified profile.

HISTORY

The resticprofile utility, of which unschedule is a part, emerged from the need for a simplified and standardized way to manage multiple restic backup configurations and automate their execution. Developed as a community-driven script, it abstracts away the complexities of directly interacting with crontab or systemd units, providing a higher-level interface for scheduling, managing, and maintaining restic backups. The unschedule command was a necessary counterpart to schedule, ensuring users could easily deactivate automated backups without manual intervention in system configuration files.

SEE ALSO

Copied to clipboard