Help with cron job for backups

I'd like to shut down my mail server every morning at 2:00AM so I can run MAILBFR to backup to an external fw drive and then start the mail server again. *deep breath*

My problem is, how? I've read the Command Line.pdf but the section on cron isn't helpful. It seems that cron runs commands at a specified time but I have no way of determining exactly when to restart the mail server once mailbfr is done backing up. Ideally, I'd like to have a way to fire off each command as soon as the last was done. Kind of like an MSDOS batch file.

Could someone help me out with a step by step way of doing this for my server?

Dual G4/G5 XServes - Dual G5 Powermac, Mac OS X (10.4.6)

Posted on Jun 30, 2006 10:24 AM

2 replies

Jul 1, 2006 6:09 PM in response to Community User

The following is a single line (may get wrapped in this forum) which you can add to /etc/crontab to execute a backup nightly (with stop/start standard part of mailbfr). It also appends output to system.log, if you don't care about that then delete the >> and everything to the right of it. The 'mailbackup' should be a complete path to an existing folder where you wish the backup to be directed.

0 2 * * * root /usr/sbin/mailbfr -b /mailbackup/ >> /private/var/log/system.log

This would execute the script at 2:00am every day.
Your crontab may already have an entry (depending on install), so follow it's format. The 0 2 * * * can be seperate with any number of spaces or tab(s).

Jeff

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Help with cron job for backups

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.