changes to AutoBackModule. Time interval is now unique and only definable on OpenSim.ini. All enabled regions will be saved in sequence whne it expires. Interval is time since last region save end, so will not follow wall clock. This reduces the chance of overlapped saves. Console command renamed to dooarbackup to be more distint from db backup. Lost the region load checks, to put back later

This commit is contained in:
UbitUmarov
2017-06-21 03:31:07 +01:00
parent 79e166e9aa
commit 651952e01e
2 changed files with 224 additions and 559 deletions

View File

@@ -38,26 +38,24 @@ namespace OpenSim.Region.OptionalModules.World.AutoBackup
///
public class AutoBackupModuleState
{
private Dictionary<Guid, string> m_liveRequests = null;
public AutoBackupModuleState()
{
this.Enabled = false;
this.BackupDir = ".";
this.BusyCheck = true;
this.SkipAssets = false;
this.Timer = null;
this.NamingType = NamingType.Time;
this.Script = null;
this.KeepFilesForDays = 0;
Enabled = false;
BackupDir = ".";
SkipAssets = false;
NamingType = NamingType.Time;
Script = null;
KeepFilesForDays = 0;
}
public Dictionary<Guid, string> LiveRequests
public AutoBackupModuleState(AutoBackupModuleState copyFrom)
{
get {
return this.m_liveRequests ??
(this.m_liveRequests = new Dictionary<Guid, string>(1));
}
Enabled = copyFrom.Enabled;
BackupDir = copyFrom.BackupDir;
SkipAssets = copyFrom.SkipAssets;
NamingType = copyFrom.NamingType;
Script = copyFrom.Script;
KeepFilesForDays = copyFrom.KeepFilesForDays;
}
public bool Enabled
@@ -66,33 +64,6 @@ namespace OpenSim.Region.OptionalModules.World.AutoBackup
set;
}
public System.Timers.Timer Timer
{
get;
set;
}
public double IntervalMinutes
{
get
{
if (this.Timer == null)
{
return -1.0;
}
else
{
return this.Timer.Interval / 60000.0;
}
}
}
public bool BusyCheck
{
get;
set;
}
public bool SkipAssets
{
get;
@@ -126,10 +97,7 @@ namespace OpenSim.Region.OptionalModules.World.AutoBackup
public new string ToString()
{
string retval = "";
retval += "[AUTO BACKUP]: AutoBackup: " + (Enabled ? "ENABLED" : "DISABLED") + "\n";
retval += "[AUTO BACKUP]: Interval: " + IntervalMinutes + " minutes" + "\n";
retval += "[AUTO BACKUP]: Do Busy Check: " + (BusyCheck ? "Yes" : "No") + "\n";
retval += "[AUTO BACKUP]: Naming Type: " + NamingType.ToString() + "\n";
retval += "[AUTO BACKUP]: Backup Dir: " + BackupDir + "\n";
retval += "[AUTO BACKUP]: Script: " + Script + "\n";
@@ -137,4 +105,3 @@ namespace OpenSim.Region.OptionalModules.World.AutoBackup
}
}
}