- "Scott Sharkey" <[EMAIL PROTECTED]>:

| I've got a disk filling up, and I think that qmail is gonna
| have to be moved.  Can anyone give suggestions for moving 
| the /var/qmail directories without too much disruption? 
| 
| I'm assuming that I need to stop incoming mail for a while,
| let the queue empty out, and then can move the whole thing
| and restart.  Any thing I've missed?

You don't really need to empty the queue, but you must take care in
moving the message files across, since the number of any message must
match the inode number of its file in mess/.

So your best bet is probably this:

- Stop the queue and the smtp server.
- Move /var/qmail aside.
- Install your new qmail from sources into /var/qmail.
- Copy the contents of the control, alias, users directories from the
  old to the new location.
- Create a subdirectory queue.old, and copy the old queue tree to it.
- Then run the following script:

#!/bin/sh
# This must be GNU find:
find queue.old/mess -type f -printf '%f %i\n' |
 awk '{print $1, $1%23, $2, $2%23}' |
 while read oldi oldd newi newd; do
  mv queue.old/mess/$oldd/$oldi queue/mess/$newd/$newi
  mv queue.old/info/$oldd/$oldi queue/info/$newd/$newi
  test -f queue.old/local/$oldd/$oldi &&
       mv queue.old/local/$oldd/$oldi queue/local/$newd/$newi
  test -f queue.old/remote/$oldd/$oldi &&
       mv queue.old/remote/$oldd/$oldi queue/remote/$newd/$newi
  test -f queue.old/bounce/$oldi &&
       mv queue.old/bounce/$oldi queue/bounce/$newi
  test -f queue.old/todo/$oldi &&
       mv queue.old/todo/$oldi queue/todo/$newi
 done

Then it should be OK to restart the queue and smtpd.

- Harald

Reply via email to