summaryrefslogtreecommitdiff
path: root/.local/bin/cron/crontog
blob: c9a640fcc9f03906145349e9d8906c018e7e608f (plain)
1
2
3
4
5
6
#!/bin/sh

# Toggles all cronjobs off/on.
# Stores disabled crontabs in ~/.config/cronsaved until restored.

([ -f "${XDG_CONFIG_HOME:-$HOME/.config}"/cronsaved ] && crontab - < "${XDG_CONFIG_HOME:-$HOME/.config}"/cronsaved  && rm "${XDG_CONFIG_HOME:-$HOME/.config}"/cronsaved && notify-send "🕓 Cronjobs re-enabled.") || ( crontab -l > "${XDG_CONFIG_HOME:-$HOME/.config}"/cronsaved && crontab -r && notify-send "🕓 Cronjobs saved and disabled.")