From dd09bad2f28dfb27f265a4d7e85e0fd103b086a4 Mon Sep 17 00:00:00 2001 From: Kenneth Hsu Date: Thu, 19 Sep 2019 16:30:51 -0700 Subject: [PATCH 1/6] Fix search for ellipsis in GUI tests. The three periods were replaced by an ellipsis in revision 7ff50a30e1 (pull request #3885). --- guiTests/guiTest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/guiTests/guiTest.py b/guiTests/guiTest.py index d2586e9e8..882c8b0a6 100644 --- a/guiTests/guiTest.py +++ b/guiTests/guiTest.py @@ -142,10 +142,10 @@ driver.find_element_by_link_text(BACKUP_NAME).click() wait_for_text(60, "//div[@class='task ng-scope']/dl[2]/dd[1]", "(took ") # Restore -if len([n for n in driver.find_elements_by_xpath("//span[contains(text(),'Restore files ...')]") if n.is_displayed()]) == 0: +if len([n for n in driver.find_elements_by_xpath(u"//span[contains(text(),'Restore files \u2026')]") if n.is_displayed()]) == 0: driver.find_element_by_link_text(BACKUP_NAME).click() -[n for n in driver.find_elements_by_xpath("//span[contains(text(),'Restore files ...')]") if n.is_displayed()][0].click() +[n for n in driver.find_elements_by_xpath(u"//span[contains(text(),'Restore files \u2026')]") if n.is_displayed()][0].click() driver.find_element_by_xpath("//span[contains(text(),'" + SOURCE_FOLDER + "')]") # wait for filelist time.sleep(1) driver.find_element_by_xpath("//restore-file-picker/ul/li/div/a[2]").click() # select root folder checkbox From 7dffbaf8007223dfce54c9995f2e78af1f352509 Mon Sep 17 00:00:00 2001 From: Kyle Stanfield Date: Fri, 20 Sep 2019 19:08:26 -0700 Subject: [PATCH 2/6] Changed NormalizeDateTimeToEpochSeconds to use ToUnixTimeSeconds --- Duplicati/Library/Utility/Utility.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Duplicati/Library/Utility/Utility.cs b/Duplicati/Library/Utility/Utility.cs index f00498fdb..8abb6efe3 100644 --- a/Duplicati/Library/Utility/Utility.cs +++ b/Duplicati/Library/Utility/Utility.cs @@ -950,9 +950,14 @@ namespace Duplicati.Library.Utility return new DateTime(ticks, DateTimeKind.Utc); } + /// + /// Given a DateTime instance, return the number of elapsed seconds since the Unix epoch + /// + /// The number of elapsed seconds since the Unix epoch + /// The input time public static long NormalizeDateTimeToEpochSeconds(DateTime input) { - return (long) Math.Floor((NormalizeDateTime(input) - EPOCH).TotalSeconds); + return (new DateTimeOffset(input)).ToUnixTimeSeconds(); } /// From 8377a2bfb2bce5f18a76975373095d56815e8690 Mon Sep 17 00:00:00 2001 From: BlueBlock Date: Sat, 21 Sep 2019 10:27:57 -0400 Subject: [PATCH 3/6] fix deleting old remotevolume records that use the old datetime method --- Duplicati/Library/Main/Database/LocalDatabase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Duplicati/Library/Main/Database/LocalDatabase.cs b/Duplicati/Library/Main/Database/LocalDatabase.cs index 55aa234c8..e41b02d6c 100644 --- a/Duplicati/Library/Main/Database/LocalDatabase.cs +++ b/Duplicati/Library/Main/Database/LocalDatabase.cs @@ -135,7 +135,7 @@ namespace Duplicati.Library.Main.Database m_removeremotevolumeCommand.CommandText = @"DELETE FROM ""Remotevolume"" WHERE ""Name"" = ? AND (""DeleteGraceTime"" < ? OR ""State"" != ?)"; m_removeremotevolumeCommand.AddParameters(3); - m_removedeletedremotevolumeCommand.CommandText = $@"DELETE FROM ""Remotevolume"" WHERE ""DeleteGraceTime"" < ? AND ""State"" == ""{RemoteVolumeState.Deleted.ToString()}"""; + m_removedeletedremotevolumeCommand.CommandText = $@"DELETE FROM ""Remotevolume"" WHERE ""State"" == ""{RemoteVolumeState.Deleted.ToString()}"" AND ""DeleteGraceTime"" < ? OR LENGTH(""DeleteGraceTime"") > 12 "; m_removedeletedremotevolumeCommand.AddParameter(); m_selectremotevolumeIdCommand.CommandText = @"SELECT ""ID"" FROM ""Remotevolume"" WHERE ""Name"" = ?"; From 75335414d58eba58402de67c2d861903a12d5cfb Mon Sep 17 00:00:00 2001 From: BlueBlock Date: Sat, 21 Sep 2019 10:31:07 -0400 Subject: [PATCH 4/6] add comment --- Duplicati/Library/Main/Database/LocalDatabase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Duplicati/Library/Main/Database/LocalDatabase.cs b/Duplicati/Library/Main/Database/LocalDatabase.cs index e41b02d6c..68ffea2a4 100644 --- a/Duplicati/Library/Main/Database/LocalDatabase.cs +++ b/Duplicati/Library/Main/Database/LocalDatabase.cs @@ -135,7 +135,7 @@ namespace Duplicati.Library.Main.Database m_removeremotevolumeCommand.CommandText = @"DELETE FROM ""Remotevolume"" WHERE ""Name"" = ? AND (""DeleteGraceTime"" < ? OR ""State"" != ?)"; m_removeremotevolumeCommand.AddParameters(3); - m_removedeletedremotevolumeCommand.CommandText = $@"DELETE FROM ""Remotevolume"" WHERE ""State"" == ""{RemoteVolumeState.Deleted.ToString()}"" AND ""DeleteGraceTime"" < ? OR LENGTH(""DeleteGraceTime"") > 12 "; + m_removedeletedremotevolumeCommand.CommandText = $@"DELETE FROM ""Remotevolume"" WHERE ""State"" == ""{RemoteVolumeState.Deleted.ToString()}"" AND ""DeleteGraceTime"" < ? OR LENGTH(""DeleteGraceTime"") > 12 "; // >12 is to handle removal of old records that were in milliseconds m_removedeletedremotevolumeCommand.AddParameter(); m_selectremotevolumeIdCommand.CommandText = @"SELECT ""ID"" FROM ""Remotevolume"" WHERE ""Name"" = ?"; From 025d4e8b4a74a6b1caa7d35b87098d3abe5aaf1e Mon Sep 17 00:00:00 2001 From: Kenneth Skovhede Date: Mon, 23 Sep 2019 09:14:18 +0200 Subject: [PATCH 5/6] Updated symlink text as suggested https://forum.duplicati.com/t/symlink-follow/8082/3 --- Duplicati/Library/Main/Strings.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Duplicati/Library/Main/Strings.cs b/Duplicati/Library/Main/Strings.cs index 8fba44aac..4ad1339d5 100644 --- a/Duplicati/Library/Main/Strings.cs +++ b/Duplicati/Library/Main/Strings.cs @@ -128,7 +128,7 @@ namespace Duplicati.Library.Main.Strings public static string QuotaWarningThresholdLong { get { return LC.L(@"Sets a threshold for when to warn about the backend quota being nearly exceeded. It is given as a percentage, and a warning is generated if the amount of available quota is less than this percentage of the total backup size. If the backend does not report the quota information, this value will be ignored"); } } public static string QuotaWarningThresholdShort { get { return LC.L(@"Threshold for warning about low quota"); } } public static string SymlinkpolicyShort { get { return LC.L(@"Symlink handling"); } } - public static string SymlinkpolicyLong(string store, string ignore, string follow) { return LC.L(@"Use this option to handle symlinks differently. The ""{0}"" option will simply record a symlink with its name and destination, and a restore will recreate the symlink as a link. Use the option ""{1}"" to ignore all symlinks and not store any information about them. Previous versions of Duplicati used the setting ""{2}"", which will cause symlinked files to be included and restore as normal files.", store, ignore, follow); } + public static string SymlinkpolicyLong(string store, string ignore, string follow) { return LC.L(@"Use this option to handle symlinks differently. The ""{0}"" option will simply record a symlink with its name and destination, and a restore will recreate the symlink as a link. Use the option ""{1}"" to ignore all symlinks and not store any information about them. The option ""{2}"" will cause the symlinked target to be backed up and restored as a normal file with the symlink name. Early versions of Duplicati did not support this option and bevhaved as if ""{2}"" was specified.", store, ignore, follow); } public static string HardlinkpolicyShort { get { return LC.L(@"Hardlink handling"); } } public static string HardlinkpolicyLong(string first, string all, string none) { return LC.L(@"Use this option to handle hardlinks (only works on Linux/OSX). The ""{0}"" option will record a hardlink ID for each hardlink to avoid storing hardlinked paths multiple times. The option ""{1}"" will ignore hardlink information, and treat each hardlink as a unique path. The option ""{2}"" will ignore all hardlinks with more than one link.", first, all, none); } public static string ExcludefilesattributesShort { get { return LC.L(@"Exclude files by attribute"); } } From cd4b6537713b786d79cc53fd1edbe4438ec4223d Mon Sep 17 00:00:00 2001 From: BlueBlock Date: Mon, 23 Sep 2019 05:22:06 -0400 Subject: [PATCH 6/6] fix sql and comment --- Duplicati/Library/Main/Database/LocalDatabase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Duplicati/Library/Main/Database/LocalDatabase.cs b/Duplicati/Library/Main/Database/LocalDatabase.cs index 68ffea2a4..aa1265559 100644 --- a/Duplicati/Library/Main/Database/LocalDatabase.cs +++ b/Duplicati/Library/Main/Database/LocalDatabase.cs @@ -135,7 +135,7 @@ namespace Duplicati.Library.Main.Database m_removeremotevolumeCommand.CommandText = @"DELETE FROM ""Remotevolume"" WHERE ""Name"" = ? AND (""DeleteGraceTime"" < ? OR ""State"" != ?)"; m_removeremotevolumeCommand.AddParameters(3); - m_removedeletedremotevolumeCommand.CommandText = $@"DELETE FROM ""Remotevolume"" WHERE ""State"" == ""{RemoteVolumeState.Deleted.ToString()}"" AND ""DeleteGraceTime"" < ? OR LENGTH(""DeleteGraceTime"") > 12 "; // >12 is to handle removal of old records that were in milliseconds + m_removedeletedremotevolumeCommand.CommandText = $@"DELETE FROM ""Remotevolume"" WHERE ""State"" == ""{RemoteVolumeState.Deleted.ToString()}"" AND (""DeleteGraceTime"" < ? OR LENGTH(""DeleteGraceTime"") > 12) "; // >12 is to handle removal of old records that were in ticks m_removedeletedremotevolumeCommand.AddParameter(); m_selectremotevolumeIdCommand.CommandText = @"SELECT ""ID"" FROM ""Remotevolume"" WHERE ""Name"" = ?";