diff options
Diffstat (limited to 'OpenSim/Region/OptionalModules/World/AutoBackup/AutoBackupModule.cs')
-rw-r--r-- | OpenSim/Region/OptionalModules/World/AutoBackup/AutoBackupModule.cs | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/OpenSim/Region/OptionalModules/World/AutoBackup/AutoBackupModule.cs b/OpenSim/Region/OptionalModules/World/AutoBackup/AutoBackupModule.cs index 1d35c54..bbb77ad 100644 --- a/OpenSim/Region/OptionalModules/World/AutoBackup/AutoBackupModule.cs +++ b/OpenSim/Region/OptionalModules/World/AutoBackup/AutoBackupModule.cs | |||
@@ -76,6 +76,8 @@ namespace OpenSim.Region.OptionalModules.World.AutoBackup | |||
76 | /// AutoBackupBusyCheck: True/False. Default: True. | 76 | /// AutoBackupBusyCheck: True/False. Default: True. |
77 | /// If True, we will only take an auto-backup if a set of conditions are met. | 77 | /// If True, we will only take an auto-backup if a set of conditions are met. |
78 | /// These conditions are heuristics to try and avoid taking a backup when the sim is busy. | 78 | /// These conditions are heuristics to try and avoid taking a backup when the sim is busy. |
79 | /// AutoBackupSkipAssets | ||
80 | /// If true, assets are not saved to the oar file. Considerably reduces impact on simulator when backing up. Intended for when assets db is backed up separately | ||
79 | /// AutoBackupScript: String. Default: not specified (disabled). | 81 | /// AutoBackupScript: String. Default: not specified (disabled). |
80 | /// File path to an executable script or binary to run when an automatic backup is taken. | 82 | /// File path to an executable script or binary to run when an automatic backup is taken. |
81 | /// The file should really be (Windows) an .exe or .bat, or (Linux/Mac) a shell script or binary. | 83 | /// The file should really be (Windows) an .exe or .bat, or (Linux/Mac) a shell script or binary. |
@@ -258,6 +260,8 @@ namespace OpenSim.Region.OptionalModules.World.AutoBackup | |||
258 | AutoBackupModuleState abms = this.ParseConfig(scene, false); | 260 | AutoBackupModuleState abms = this.ParseConfig(scene, false); |
259 | m_log.Debug("[AUTO BACKUP]: Config for " + scene.RegionInfo.RegionName); | 261 | m_log.Debug("[AUTO BACKUP]: Config for " + scene.RegionInfo.RegionName); |
260 | m_log.Debug((abms == null ? "DEFAULT" : abms.ToString())); | 262 | m_log.Debug((abms == null ? "DEFAULT" : abms.ToString())); |
263 | |||
264 | m_states.Add(scene, abms); | ||
261 | } | 265 | } |
262 | 266 | ||
263 | /// <summary> | 267 | /// <summary> |
@@ -334,7 +338,7 @@ namespace OpenSim.Region.OptionalModules.World.AutoBackup | |||
334 | double interval = | 338 | double interval = |
335 | this.ResolveDouble("AutoBackupInterval", this.m_defaultState.IntervalMinutes, | 339 | this.ResolveDouble("AutoBackupInterval", this.m_defaultState.IntervalMinutes, |
336 | config, regionConfig) * 60000.0; | 340 | config, regionConfig) * 60000.0; |
337 | if (state == null && interval != this.m_defaultState.IntervalMinutes*60000.0) | 341 | if (state == null && interval != this.m_defaultState.IntervalMinutes * 60000.0) |
338 | { | 342 | { |
339 | state = new AutoBackupModuleState(); | 343 | state = new AutoBackupModuleState(); |
340 | } | 344 | } |
@@ -412,6 +416,19 @@ namespace OpenSim.Region.OptionalModules.World.AutoBackup | |||
412 | state.BusyCheck = tmpBusyCheck; | 416 | state.BusyCheck = tmpBusyCheck; |
413 | } | 417 | } |
414 | 418 | ||
419 | // Included Option To Skip Assets | ||
420 | bool tmpSkipAssets = ResolveBoolean("AutoBackupSkipAssets", | ||
421 | this.m_defaultState.SkipAssets, config, regionConfig); | ||
422 | if (state == null && tmpSkipAssets != this.m_defaultState.SkipAssets) | ||
423 | { | ||
424 | state = new AutoBackupModuleState(); | ||
425 | } | ||
426 | |||
427 | if (state != null) | ||
428 | { | ||
429 | state.SkipAssets = tmpSkipAssets; | ||
430 | } | ||
431 | |||
415 | // Set file naming algorithm | 432 | // Set file naming algorithm |
416 | string stmpNamingType = ResolveString("AutoBackupNaming", | 433 | string stmpNamingType = ResolveString("AutoBackupNaming", |
417 | this.m_defaultState.NamingType.ToString(), config, regionConfig); | 434 | this.m_defaultState.NamingType.ToString(), config, regionConfig); |
@@ -488,6 +505,9 @@ namespace OpenSim.Region.OptionalModules.World.AutoBackup | |||
488 | } | 505 | } |
489 | } | 506 | } |
490 | 507 | ||
508 | if(state == null) | ||
509 | return m_defaultState; | ||
510 | |||
491 | return state; | 511 | return state; |
492 | } | 512 | } |
493 | 513 | ||
@@ -640,7 +660,7 @@ namespace OpenSim.Region.OptionalModules.World.AutoBackup | |||
640 | /// <param name="scene"></param> | 660 | /// <param name="scene"></param> |
641 | private void DoRegionBackup(IScene scene) | 661 | private void DoRegionBackup(IScene scene) |
642 | { | 662 | { |
643 | if (scene.RegionStatus != RegionStatus.Up) | 663 | if (!scene.Ready) |
644 | { | 664 | { |
645 | // We won't backup a region that isn't operating normally. | 665 | // We won't backup a region that isn't operating normally. |
646 | m_log.Warn("[AUTO BACKUP]: Not backing up region " + scene.RegionInfo.RegionName + | 666 | m_log.Warn("[AUTO BACKUP]: Not backing up region " + scene.RegionInfo.RegionName + |
@@ -662,7 +682,16 @@ namespace OpenSim.Region.OptionalModules.World.AutoBackup | |||
662 | m_pendingSaves.Add(guid, scene); | 682 | m_pendingSaves.Add(guid, scene); |
663 | state.LiveRequests.Add(guid, savePath); | 683 | state.LiveRequests.Add(guid, savePath); |
664 | ((Scene) scene).EventManager.OnOarFileSaved += new EventManager.OarFileSaved(EventManager_OnOarFileSaved); | 684 | ((Scene) scene).EventManager.OnOarFileSaved += new EventManager.OarFileSaved(EventManager_OnOarFileSaved); |
665 | iram.ArchiveRegion(savePath, guid, null); | 685 | |
686 | m_log.Info("[AUTO BACKUP]: Backing up region " + scene.RegionInfo.RegionName); | ||
687 | |||
688 | // Must pass options, even if dictionary is empty! | ||
689 | Dictionary<string, object> options = new Dictionary<string, object>(); | ||
690 | |||
691 | if (state.SkipAssets) | ||
692 | options["noassets"] = true; | ||
693 | |||
694 | iram.ArchiveRegion(savePath, guid, options); | ||
666 | } | 695 | } |
667 | 696 | ||
668 | /// <summary> | 697 | /// <summary> |