[Samba] samba_backup script doesn't use tdbbackup for tdb files?

Rowland Penny rpenny at samba.org
Sat Dec 10 07:57:27 UTC 2016


On 09 Dec 2016 21:52:39 UTC
Don via samba <samba at lists.samba.org> wrote:

> Greetings,
> 
> The backup and restore Samba AD DC section of SambaWiki [1] refers to
> ./source4/scripting/bin/samba_backup . Although my recent version of 
> samba_backup uses tdbbackup on ldb files, it appears to tar tdb files
> "as is." [2]
> 
> What gives? Isn't tdbbackup specifically designed to backup tdb
> files? Is it now possible to simply copy open tdb files into an
> archive?
> 
> Note.
> 
> 1. https://wiki.samba.org/index.php/Backup_and_restore_an_Samba_AD_DC
> 
> 2. script snippet sans error handling
> 
>      if [ "$d" = "private" ]; then
>        find $relativedirname -name "*.ldb.bak" -exec rm {} \;
>          for ldb in `find $relativedirname -name "*.ldb"`; do
>            tdbbackup $ldb
>          done
>          tar cjf ${WHERE}/samba4_${n}.${WHEN}.tar.bz2
> $relativedirname --exclude=*.ldb >/dev/null 2>&1
> 
> Thank you,
> 

If you read the code snippet carefully, you will see that tdbbackup
backs up each .ldb file 'tdbbackup $ldb', this results in files named
*.ldb.bak.
The script then goes on to create a tarball of all the files EXCEPT
the original *.ldb files, this is done by this '--exclude=*.ldb'

Rowland
 



More information about the samba mailing list