Linux – How To Backup “crontab -e” Files

backupbackup-restorationcronlinux

I want to do a complete server backup.

I already have my backup script copying all of the html/php files for the web app, and the mysql databases, placing them into a .tar.gz file.

How can I add the crontab files to that backup?

Whenever I save the crontab, it goes to /tmp folder.. and when I check that folder immediately afterwards, it is empty.

Best Answer

You could just backup the entire /var/spool/cron directory. It contains all crontabs of all users.

Related Topic