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.

link|improve this question

Just a though, may versions of cron allow root to place the jobs in /etc/cron.d/, I generally prefer that instead, since my /etc folder is backed up, and tracked in a VCS. – Zoredache Nov 18 '11 at 8:46
feedback

2 Answers

up vote 5 down vote accepted

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

link|improve this answer
Worked a treat, thanks. – darkAsPitch Nov 28 '11 at 4:11
feedback

just backup the file /var/spool/cron/USER_NAME

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.