]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
samba-tool: domain tombstones expunge reminds on semi-noop
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Thu, 7 Jan 2021 03:14:45 +0000 (16:14 +1300)
committerJeremy Allison <jra@samba.org>
Wed, 17 Mar 2021 17:10:32 +0000 (17:10 +0000)
Sometimes people assume `samba-tool domain tombstones expunge` will
expunge tombstones, but in the general case it won't because it only
affects those that have reached the tombstone lifetime, but these are
likely to have already been deleted by the regularly scheduled task.
You need to set the tombstone lifetime to have much effect.

This patch doesn't change the behaviour, but it does warn the user
that they are probably doing nothing of significance.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jeremy Allison <jra@samba.org>
python/samba/netcmd/domain.py

index 6a02b2ecac0ee3f2d14b4ed66f612a49a159e5e7..ffabe8098c0888bd40ba9c41c42dda2f368e407c 100644 (file)
@@ -3822,6 +3822,13 @@ This command expunges tombstones from the database."""
         samdb = SamDB(url=H, session_info=system_session(),
                       credentials=creds, lp=lp)
 
+        if current_time_string is None and tombstone_lifetime is None:
+            print("Note: without --current-time or --tombstone-lifetime "
+                  "only tombstones already scheduled for deletion will "
+                  "be deleted.", file=self.outf)
+            print("To remove all tombstones, use --tombstone-lifetime=0.",
+                  file=self.outf)
+
         if current_time_string is not None:
             current_time_obj = time.strptime(current_time_string, "%Y-%m-%d")
             current_time = int(time.mktime(current_time_obj))