Afficher un message
Vieux 04/10/2006, 23h54   #2
Dennis Peterson
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Copy mailertable.db access.db generics.db etc etc ....

martin_group wrote:
> I have 2 mail relays which need to have identical mailertable.db
> virtusertable.db access.db etc etc . I have considered rsync and scp
> to copy the files over from the primary to the secondary mx box , but
> find I am I complete rookie when it comes to scp and rsync. I intend to
> use rsync with ssh or scp with ssh and thats as far as I get. Has any
> body tried this set up or has somebody got some ideas on how to go
> about this ??
> [ssh is set so that root access is denied.]
>
>
> Many Thanks
>


Copy the text file to each target machine and have a cron job on each
machine recreate the db file. I use cfengine here so no cron job is
needed, but scp and rsync will work fine along with the cron process.

A crontab entry could be as simple as:

0,10,20,30,40,50 * * * * cd /etc/mail;make >/dev/null 2>&1

and have a Makefile in /etc/mail that does the dirty work. Assuming the
text files are found in /home/smtp this inelegant Makefile works:

all: virtusertable.db access.db aliases.db mailertable.db

virtusertable.db: /home/smtp/virtusertable
/usr/sbin/makemap hash virtusertable < /home/smtp/virtusertable

mailertable.db: /home/smtp/mailertable
/usr/sbin/makemap hash mailertable < /home/smtp/mailertable

access.db: /home/smtp/access
/usr/sbin/makemap hash </home/smtp/access

aliases.db: /home/smtp/aliases
/usr/bin/cp /home/smtp/aliases /etc
/usr/bin/newaliases

This is not a model of sophistication but will work. Sendmail does not
require a restart when db files are modified. Make will update files
only when the source is newer than than created db file and so there is
very little load imposed on the system.

dp
  Réponse avec citation
 
Page generated in 0,05746 seconds with 9 queries