carstein.seeberg

Script to compress replication queues

Discussion created by carstein.seeberg on Dec 3, 2008
Hi all,

Thought I'd share this little snippet that can be scheduled to run during the night, or once per week.
It will compress the replication queues in the replication directory by using the VACUUM sql-statement.  Please note that this needs to be tweaked to support 'ls' if targeted for UNIX.
This functionality will be added to the automatic NAS maintenance routines in the next release, so consider this to be a temporary workaround.

Enjoy,
Carstein

---8<----8<----8<----8<----8<----8<----8<----8<-

-- Using the Windows DIR command
q = action.command("dir /B replication\\*.db")

for i=1,#q do
   printf("Compressing replication queue '%s'",q)

   database.open ("replication\\"..q)
   database.query("VACUUM")
   database.close()

end

Outcomes