Koozali.org: home of the SME Server

best way to stop and restart email in a script?

guest1618

best way to stop and restart email in a script?
« on: January 17, 2008, 08:29:52 AM »
I would like to have a script run every night to backup my server using rsync and I'd like to stop the email while rsync runs. It doesn't take long, only a few minutes, and would not impact users email since they don't get much between 1am and about 4am. What's the best way to stop and restart email cleanly for the duration of the rsync run?

Offline m

  • *****
  • 276
  • +0/-0
  • Peet
Re: best way to stop and restart email in a script?
« Reply #1 on: January 18, 2008, 12:42:22 AM »
IMO it is not necessary to do this. If you ever must restore from a backup you will loose all the mails received after the last rsync run which is in worst case 24 h old. So what does it matter when you backup a few corrupted mails during the rsync run? But if you really want to do it, try:

stopping:
service imap stop
service imaps stop
service pop3 stop
service pop3s stop
service qmail stop

starting:
service imap start
service imaps start
service pop3 start
service pop3s start
service qmail start



guest1618

Re: best way to stop and restart email in a script?
« Reply #2 on: January 18, 2008, 01:47:23 AM »
IMO it is not necessary to do this. If you ever must restore from a backup you will loose all the mails received after the last rsync run which is in worst case 24 h old. So what does it matter when you backup a few corrupted mails during the rsync run? But if you really want to do it, try:

Thanks for the suggestion. I want to eliminate the file missing errors if possible. Maybe I'b being paranoid but I try for no errors when possible.