[Samba] notice backup script update!

Norbert Hanke
2018-01-02T15:57:39Z

Hi Louis,

Thanks for maintaining that script! I took some time today to put it
into life at my site.

I hit on two issues:

The "#!/bin/bash -e" shebang line causes the script to exit at the
first
error. Good for debugging, but in production it stops backing up the rest.

When used on a default-built samba version it fails on the config
directory: it correctly finds /usr/local/samba/etc but it should search
for "etc" from one level higher.
I fixed that by searching in ".." :
***************
*** 335,341 ****
           if [ "${CONFILE}" = "/etc/samba/smb.conf" ]; then
               relativedirname=$(${CMD_FIND} . -type d -name "$d"
-prune)
           else
!             relativedirname=$(${CMD_FIND} . -type d -name "etc"
-prune)
           fi
             # Run the backup.
             # --warning=no-file-ignored suppresses "socket ignored"
messages.
--- 335,341 ----
           if [ "${CONFILE}" = "/etc/samba/smb.conf" ]; then
               relativedirname=$(${CMD_FIND} . -type d -name "$d"
-prune)
           else
!             relativedirname=$(${CMD_FIND} .. -type d -name "etc"
-prune)
           fi
             # Run the backup.
             # --warning=no-file-ignored suppresses "socket ignored"
messages.
***************

I hope that helps.

Regards,
Norbert


On 19.12.2017 10:54, L.P.H. van Belle via samba wrote:
> Hai,
>
> For the people using my modified backup script.
> Found here:
> https://github.com/thctlo/samba4/tree/master/backup-script
>
> I've updated it, due to bug
https://bugzilla.samba.org/show_bug.cgi?id=13088   netlogon_creds_cli.tdb will
be excluded from the backup.
> Due to this the script exits and does not backup anything since
netlogon_creds_cli.tdb is the first it wanted to backup. ( in my case ).
>
> Keep_days is working now also.
> Tip here is, set you DAYS high, i've set a default of 60 days now and
if KEEP_DAYS="yes" then all files older then 60 days will be removed
from the backup, except dates with -01- -15-  .
>
> Update you backup script or please do check if its running as it should.
> I have not checked the original by samba source provided backup script,
just beware and check it.
>
>
> Greetz,
>
> Louis
>