diff options
Diffstat (limited to 'Duplicati/Library/Main/Database/LocalDatabase.cs')
-rw-r--r-- | Duplicati/Library/Main/Database/LocalDatabase.cs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Duplicati/Library/Main/Database/LocalDatabase.cs b/Duplicati/Library/Main/Database/LocalDatabase.cs index 2149d9270..b8cfbbde8 100644 --- a/Duplicati/Library/Main/Database/LocalDatabase.cs +++ b/Duplicati/Library/Main/Database/LocalDatabase.cs @@ -934,6 +934,21 @@ namespace Duplicati.Library.Main.Database }
}
+
+ public void PurgeLogData(DateTime threshold)
+ {
+ using(var tr = m_connection.BeginTransaction())
+ using(var cmd = m_connection.CreateCommand(tr))
+ {
+ var t = NormalizeDateTimeToEpochSeconds(threshold);
+ cmd.ExecuteNonQuery(@"DELETE FROM ""LogData"" WHERE ""Timestamp"" < ?", t);
+ cmd.ExecuteNonQuery(@"DELETE FROM ""RemoteOperation"" WHERE ""Timestamp"" < ?", t);
+
+ tr.Commit();
+ }
+ using(var cmd = m_connection.CreateCommand())
+ cmd.ExecuteNonQuery("VACUUM");
+ }
public virtual void Dispose()
{
|