better-crontab protects your crontab commands. It helps avoid accidental deletions when using crontab -e (edit) or crontab -r (delete). These commands can remove your scheduled tasks unintentionally. This software adds a layer of safety by asking for confirmation before these actions.
In Linux systems, the crontab command has important options:
crontab -e: Edit the current userโs crontab file.crontab -r: Delete the entire crontab file without confirmation.crontab -l: List the content of the current userโs crontab.Main Risks:
e and r keys are next to each other on a QWERTY keyboard.crontab -r directly deletes your work without asking.crontab -r.sudo curl -o /usr/local/bin/better-crontab https://raw.githubusercontent.com/doggy8088/better-crontab/main/better-crontab
less /usr/local/bin/better-crontab
sudo chmod +x /usr/local/bin/better-crontab
~/.bashrc or ~/.zshrc file:
alias crontab='/usr/local/bin/better-crontab'
source ~/.bashrc
Visit the Releases Page Go to the better-crontab releases page.
Download the Latest Version Choose the appropriate version for your system and download it.
Install the Script Once downloaded, follow the installation steps similar to Method 1.
crontab -e
crontab -r
You will receive a confirmation prompt before the deletion proceeds.
crontab -l
Permission Issues: If you encounter permission errors, make sure you run the installation commands with sudo.
Alias Not Working: If the alias does not seem to work, verify you added it correctly to your ~/.bashrc or ~/.zshrc file and that you executed source to refresh your shell.
Unexpected Messages: If you see an unexpected error message, check the script file for any modification you may have made.
For additional support, please visit the better-crontab GitHub page or open an issue in the repository. Your feedback helps us improve!
We welcome contributions from everyone! If youโd like to help improve better-crontab, please fork the repository and submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.