Skip to content

Wrapper for crontab that automatically includes the -i flag, preventing accidental deletion of the user's crontab with the -r flag.

Notifications You must be signed in to change notification settings

cuddlyclara/safecron

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

SafeCron

SafeCron is a wrapper for the crontab command that automatically includes the -i flag to prevent accidental deletion of the user's crontab when using the -r flag.

Installation

To install SafeCron, use one of the following methods:

Using wget

sudo wget -q https://raw.githubusercontent.com/cuddlyclara/safecron/refs/heads/main/safecron.sh -O /usr/local/bin/safecron && sudo chmod +x /usr/local/bin/safecron

Using curl

sudo curl -s https://raw.githubusercontent.com/cuddlyclara/safecron/refs/heads/main/safecron.sh -o /usr/local/bin/safecron && sudo chmod +x /usr/local/bin/safecron

Usage

Once installed, you can use safecron just like the regular crontab command. It will automatically include the -i flag for safety, preventing any accidental deletion of crontab entries.

Example

To edit your crontab:

safecron -e

If you run the following command to delete your crontab:

safecron -r

You will always be prompted with the following question:

crontab: really delete user's crontab? (y/n)

About

Wrapper for crontab that automatically includes the -i flag, preventing accidental deletion of the user's crontab with the -r flag.

Topics

Resources

Stars

Watchers

Forks

Languages