Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

share|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
    
    
With regard to your username, sorry to take away your '666' upvote count -but I found the post useful. ;) –  a coder Sep 19 '13 at 15:30

2 Answers 2

up vote 8 down vote accepted

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

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

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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