diff options
author | Kenneth Skovhede <kenneth@hexad.dk> | 2018-03-22 10:32:48 +0300 |
---|---|---|
committer | Kenneth Skovhede <kenneth@hexad.dk> | 2018-03-22 10:32:48 +0300 |
commit | 9e48de8e01f07273550ff9245d825d79cdb6d815 (patch) | |
tree | 0c8594884f6d54927c0243c00a27aeed04da12b0 /Duplicati/Server/Scheduler.cs | |
parent | e9d477889f5d615b1ed7ccdd5f72f7daf991c8b8 (diff) | |
parent | e544b871dc04d5ecc3bcf41a4504cbb6f6768172 (diff) |
Merge branch 'master' of github.com:duplicati/duplicati
Diffstat (limited to 'Duplicati/Server/Scheduler.cs')
-rw-r--r-- | Duplicati/Server/Scheduler.cs | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/Duplicati/Server/Scheduler.cs b/Duplicati/Server/Scheduler.cs index 41325f70a..fb01df458 100644 --- a/Duplicati/Server/Scheduler.cs +++ b/Duplicati/Server/Scheduler.cs @@ -34,6 +34,8 @@ namespace Duplicati.Server /// </summary>
public class Scheduler
{
+ private static readonly string LOGTAG = Duplicati.Library.Logging.Log.LogTagFromType<Scheduler>();
+
/// <summary>
/// The thread that runs the scheduler
/// </summary>
@@ -53,7 +55,7 @@ namespace Duplicati.Server /// <summary>
/// The data syncronization lock
/// </summary>
- private object m_lock = new object();
+ private readonly object m_lock = new object();
/// <summary>
/// An event that is raised when the schedule changes
@@ -278,7 +280,18 @@ namespace Duplicati.Server {
var entry = Program.DataConnection.GetBackup(id);
if (entry != null)
- jobsToRun.Add(Server.Runner.CreateTask(Duplicati.Server.Serialization.DuplicatiOperation.Backup, entry));
+ {
+ Dictionary<string, string> options = Duplicati.Server.Runner.GetCommonOptions(entry, Duplicati.Server.Serialization.DuplicatiOperation.Backup);
+ Duplicati.Server.Runner.ApplyOptions(entry, Duplicati.Server.Serialization.DuplicatiOperation.Backup, options);
+ if ((new Duplicati.Library.Main.Options(options)).DisableOnBattery && (Duplicati.Library.Utility.Power.PowerSupply.GetSource() == Duplicati.Library.Utility.Power.PowerSupply.Source.Battery))
+ {
+ Duplicati.Library.Logging.Log.WriteInformationMessage(LOGTAG, "BackupDisabledOnBattery", "Scheduled backup disabled while on battery power.");
+ }
+ else
+ {
+ jobsToRun.Add(Server.Runner.CreateTask(Duplicati.Server.Serialization.DuplicatiOperation.Backup, entry));
+ }
+ }
}
}
|