Back up the crontab to a dated file
backup crontab | save cron jobs to file | export crontab | back up cron jobs before editing | crontab | backupcrontab -l > ~/crontab-backup-$(date +%F).txtWrites the current user’s crontab to a file like crontab-backup-2026-10-09.txt in the home directory. Restore it with crontab followed by the file name, which completely replaces the current crontab. Anyone who accidentally types crontab -r instead of crontab -e will be grateful for this backup.
Note: As root, crontab -l -u <user> also backs up another user’s crontab.
Also searched as
- backup crontab
- save cron jobs to file
- export crontab
- back up cron jobs before editing