Samba DC maintenance

I try to keep Samba servers up to date at least on a weekly basis. This is my routine:

Backup your domain (online, from DC1 for example)

You can locally backup your domain and save this file for disaster recovery purposes but:

samba-tool domain backup online --targetdir=/backup/dc1/ --server=dc1 -U "MAD\Administrator"

Please be aware in recent Samba versions (>4.20) both samba-ad-provision and samba-dsdb-modules packages are needed to perform a backup. If you are running this on a DC chances are, these are already installed.

Other weekly maintenance procedures

samba-tool domain tombstones expunge --tombstone-lifetime=0
samba-tool dbcheck --cross-ncs --fix --yes
samba-tool visualize uptodateness -rS --utf8
samba-tool fsmo show | cut -f1-2 -d,
chronyc tracking && timedatectl status
apt-get update && apt-get dist-upgrade && apt autoremove -y && apt-get autoclean && apt-get clean && apt-get remove --purge $(dpkg -l | awk '/^rc/{print $2}')

Sysvol and idmap.ldb Sync between DCs

It is very important to have sysvol and idmap.ldb synced from the PDC FSMO role owner.

I suggest you script this and run it on a regular basis.


Caponato's Samba notebook. Start here or else Main menu