├── .gitattributes ├── .gitignore ├── KPSimpleBackup.sln ├── KPSimpleBackup ├── BackupManager.cs ├── BasicBackupManager.cs ├── CleanupManager.cs ├── KPConfigBackupManager.cs ├── KPSimpleBackup.cs ├── KPSimpleBackup.csproj ├── KPSimpleBackupConfig.cs ├── LogForm.Designer.cs ├── LogForm.cs ├── LogForm.resx ├── Logger.cs ├── LongTermBackupManager.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Settings.Designer.cs │ └── Settings.settings ├── SettingsForm.Designer.cs ├── SettingsForm.cs ├── SettingsForm.resx ├── app.config └── packages.config ├── LICENSE ├── README.md ├── kpsimplebackup.version └── resources └── screenshots ├── settings_advanced.png └── settings_general.png /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vs 2 | /KPSimpleBackup/bin 3 | /KPSimpleBackup/obj 4 | 5 | # NuGet packages folder 6 | /packages -------------------------------------------------------------------------------- /KPSimpleBackup.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28307.489 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KPSimpleBackup", "KPSimpleBackup\KPSimpleBackup.csproj", "{90AE5E95-FAC2-46D6-8B6B-BAB535323BB1}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {90AE5E95-FAC2-46D6-8B6B-BAB535323BB1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {90AE5E95-FAC2-46D6-8B6B-BAB535323BB1}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {90AE5E95-FAC2-46D6-8B6B-BAB535323BB1}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {90AE5E95-FAC2-46D6-8B6B-BAB535323BB1}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {B99C9C95-947A-4F53-9A66-BC0C4C747404} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /KPSimpleBackup/BackupManager.cs: -------------------------------------------------------------------------------- 1 |  2 | using KeePass.Resources; 3 | using KeePassLib; 4 | using KeePassLib.Interfaces; 5 | using KeePassLib.Serialization; 6 | using KeePassLib.Utility; 7 | using Microsoft.VisualBasic.FileIO; 8 | using System; 9 | using System.Collections.Generic; 10 | using System.IO; 11 | 12 | namespace KPSimpleBackup 13 | { 14 | public abstract class BackupManager 15 | { 16 | 17 | protected const string FILE_PREFIX = "file:///"; 18 | private const string DEFAULT_BACKUP_FILE_EXTENSION = ".kdbx"; 19 | 20 | protected virtual string ManagerName { get; set; } 21 | 22 | protected static KPSimpleBackupConfig config; 23 | 24 | protected PwDatabase database; 25 | 26 | protected string dbFileExtension; 27 | 28 | protected string dbFileName; 29 | 30 | protected string basePath; 31 | 32 | protected static Logger pluginLogger = null; 33 | 34 | /// 35 | /// A path to a temporary copy of the database file. 36 | /// 37 | private string tempDatabaseBackupFile = null; 38 | 39 | /// 40 | /// List of temporary created files, that will be removed in the 41 | /// cleanup again. 42 | /// 43 | private List temporaryFiles; 44 | 45 | /// 46 | /// Logger used by the MainWindows of KeePass to show current status 47 | /// of saving process. 48 | /// 49 | protected static IStatusLogger KPMainWindowSwLogger = null; 50 | 51 | public BackupManager(PwDatabase database) 52 | { 53 | this.database = database; 54 | this.dbFileExtension = GetDbFileExtension(); 55 | this.dbFileName = GetBackupFileName(database); 56 | this.temporaryFiles = new List(); 57 | } 58 | 59 | public static void SetPluginLogger(Logger logger) 60 | { 61 | pluginLogger = logger; 62 | } 63 | 64 | /// 65 | /// Set the logger that should be used for saving databases. This should 66 | /// be the logger created by the main KeePass application. 67 | /// 68 | /// Logger to use while saving databases. 69 | public static void SetKPMainWindowSwLogger(KeePassLib.Interfaces.IStatusLogger logger) 70 | { 71 | KPMainWindowSwLogger = logger; 72 | } 73 | 74 | /// 75 | /// Set KPSimpleBackupConfig to use. 76 | /// 77 | /// Configuration that should be used. 78 | public static void SetConfig(KPSimpleBackupConfig config) 79 | { 80 | BackupManager.config = config; 81 | } 82 | 83 | /// 84 | /// Set a path to a file that can be temporarly used by this backup 85 | /// manager for copying it as new backup (for LTB backups, for instance). 86 | /// The file will not be deleted or modified in any way. 87 | /// 88 | /// path to the database file 89 | public void SetTempDatabaseBackupFile(string tempDatabaseBackupFile) 90 | { 91 | this.tempDatabaseBackupFile = tempDatabaseBackupFile; 92 | } 93 | 94 | /// 95 | /// Run the actual BackupManager based on the prior 96 | /// defined settings / using the prior set database. 97 | /// Backups will be created in each backup-directory 98 | /// saved in the KPSimpleBackupConfig. 99 | /// 100 | /// If the operation completed successfully without warnings 101 | public bool Run() 102 | { 103 | pluginLogger.Log("START BackupManager: " + ManagerName + " for database: " + database.Name, LogStatusType.Info); 104 | bool warning = false; 105 | 106 | List paths = config.BackupPath; 107 | foreach (string backupFolderPath in paths) 108 | { 109 | try 110 | { 111 | // ensure (possible stored) relative path is converted to an absolute one 112 | basePath = UrlUtil.EnsureTerminatingSeparator( 113 | UrlUtil.MakeAbsolutePath(database.IOConnectionInfo.Path, backupFolderPath), 114 | false 115 | ); 116 | pluginLogger.Log("Backup to next path: " + basePath, LogStatusType.Info); 117 | 118 | PreBackup(); 119 | Backup(); 120 | Cleanup(); 121 | } 122 | catch (Exception e) 123 | { 124 | warning = true; 125 | pluginLogger.Log("BackupManager (" + ManagerName + ") finished with warnings!", LogStatusType.AdditionalInfo); 126 | pluginLogger.Log("Exception: " + e.ToString(), LogStatusType.AdditionalInfo); 127 | } 128 | } 129 | 130 | pluginLogger.Log("FINISHED BackupManager: " + ManagerName, LogStatusType.Info); 131 | return ! warning; 132 | } 133 | 134 | protected abstract void PreBackup(); 135 | protected abstract void Backup(); 136 | 137 | /// 138 | /// Delete all temporary created files. 139 | /// Can be overwritten by child classes to implement/ extend by 140 | /// their own cleanup logic. 141 | /// 142 | protected virtual void Cleanup() 143 | { 144 | foreach (string tempFile in temporaryFiles) 145 | { 146 | pluginLogger.Log("Deleting temporary file: " + tempFile, LogStatusType.Info); 147 | FileSystem.DeleteFile(new Uri(tempFile).LocalPath); 148 | } 149 | } 150 | 151 | protected void SavePwDatabaseToPath(IOConnectionInfo fileInfo) 152 | { 153 | pluginLogger.Log("Save database to: " + fileInfo.Path, LogStatusType.Info); 154 | KPMainWindowSwLogger.StartLogging(KPRes.SavingDatabase, true); 155 | database.SaveAs(fileInfo, false, KPMainWindowSwLogger); 156 | KPMainWindowSwLogger.EndLogging(); 157 | } 158 | 159 | protected void SavePwDatabaseToPath(string path) 160 | { 161 | SavePwDatabaseToPath(IOConnectionInfo.FromPath(path)); 162 | } 163 | 164 | /// 165 | /// Copy the file of the currently opened database to a 166 | /// given destination path. 167 | /// 168 | /// 169 | /// Full path (including file name + extension) where the 170 | /// database file should be copied to. 171 | /// 172 | /// 173 | /// Whether to overwrite a possible conflicting destination 174 | /// file, or not. 175 | /// 176 | protected void CopyPwDatabaseFileToPath(string toPath, bool overwrite = true) 177 | { 178 | if (tempDatabaseBackupFile == null) 179 | { 180 | tempDatabaseBackupFile = GenerateTemporaryDatabaseFileCopy(); 181 | } 182 | 183 | pluginLogger.Log( 184 | "Copy database to: " + toPath + " (from: " + tempDatabaseBackupFile + ")", 185 | LogStatusType.Info 186 | ); 187 | FileSystem.CopyFile( 188 | new Uri(tempDatabaseBackupFile).LocalPath, 189 | new Uri(toPath).LocalPath, 190 | overwrite 191 | ); 192 | } 193 | 194 | /// 195 | /// Generate a timestamp (as string) based on the format defined 196 | /// by the user. 197 | /// 198 | /// Time formatted by user preference. 199 | protected string GenerateUserConfiguredTimeString() 200 | { 201 | string dateTimeFormat = config.DateFormat; 202 | return DateTime.Now.ToString(dateTimeFormat); 203 | } 204 | 205 | /// 206 | /// Generate the file extension that should be used. 207 | /// If no custom extension is set, the current db-extension 208 | /// is used, as a fallback the "standard" file extension 209 | /// is used. 210 | /// 211 | /// The database extension to use 212 | private string GetDbFileExtension() 213 | { 214 | string databaseExtension = DEFAULT_BACKUP_FILE_EXTENSION; 215 | try 216 | { 217 | if (config.UseCustomBackupFileExtension) 218 | { 219 | databaseExtension = config.BackupFileExtension; 220 | } 221 | else 222 | { 223 | string databasePath = database.IOConnectionInfo.Path; 224 | databaseExtension = Path.GetExtension(databasePath); 225 | } 226 | } 227 | catch (Exception) { } 228 | return databaseExtension; 229 | } 230 | 231 | private string GetBackupFileName(PwDatabase database) 232 | { 233 | // start with database name as 'fallback' / default 234 | string backupFileName = database.Name; 235 | 236 | // get file name if database name shouldn't be used 237 | if (! config.UseDatabaseNameForBackupFiles) 238 | { 239 | string path = database.IOConnectionInfo.Path; 240 | backupFileName = Path.GetFileNameWithoutExtension(path); 241 | } 242 | 243 | return backupFileName; 244 | } 245 | 246 | /// 247 | /// Create a temporary copy of the database file with a random 248 | /// file name and return the full path to the file. 249 | ///
The file path is also added to the list of the temporary 250 | /// files in this class. 251 | ///
252 | /// Full path to the temporary database file copy. 253 | private string GenerateTemporaryDatabaseFileCopy() 254 | { 255 | string tempFilePath = FILE_PREFIX + Path.GetTempPath() + 256 | Path.GetRandomFileName() + dbFileExtension; 257 | SavePwDatabaseToPath(tempFilePath); 258 | temporaryFiles.Add(tempFilePath); 259 | return tempFilePath; 260 | } 261 | } 262 | } 263 | -------------------------------------------------------------------------------- /KPSimpleBackup/BasicBackupManager.cs: -------------------------------------------------------------------------------- 1 | using KeePass.Plugins; 2 | using KeePassLib; 3 | using Microsoft.VisualBasic.FileIO; 4 | using System; 5 | using System.IO; 6 | 7 | namespace KPSimpleBackup 8 | { 9 | class BasicBackupManager : BackupManager 10 | { 11 | protected override string ManagerName { get { return "BasicBackup"; } } 12 | 13 | /// 14 | /// Path to the last backup file of the database that has 15 | /// been created by this backup manager. 16 | /// 17 | public string lastBackupFilePath = null; 18 | 19 | public BasicBackupManager(PwDatabase database) : base(database) 20 | { 21 | // 22 | } 23 | 24 | protected override void PreBackup() 25 | { 26 | try 27 | { 28 | Directory.CreateDirectory(basePath); 29 | } 30 | catch (Exception e) 31 | { 32 | pluginLogger.Log("Could not create backup directory!", KeePassLib.Interfaces.LogStatusType.Error); 33 | pluginLogger.Log("Exception: " + e.ToString(), KeePassLib.Interfaces.LogStatusType.AdditionalInfo); 34 | throw e; 35 | } 36 | } 37 | 38 | protected override void Backup() 39 | { 40 | string time = GenerateUserConfiguredTimeString(); 41 | string path = FILE_PREFIX + basePath + dbFileName + "_" + time + dbFileExtension; 42 | SavePwDatabaseToPath(path); 43 | lastBackupFilePath = path; 44 | } 45 | 46 | protected override void Cleanup() 47 | { 48 | base.Cleanup(); 49 | 50 | string cleanupSearchPattern = dbFileName + "_*" + dbFileExtension; 51 | CleanupManager.Cleanup(basePath, cleanupSearchPattern, database.IOConnectionInfo.Path); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /KPSimpleBackup/CleanupManager.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualBasic.FileIO; 2 | using System.IO; 3 | using System.Linq; 4 | 5 | namespace KPSimpleBackup 6 | { 7 | public static class CleanupManager 8 | { 9 | /// 10 | /// Configuration of KPSimpleBackup 11 | /// 12 | public static KPSimpleBackupConfig config; 13 | 14 | /// 15 | /// Run a file cleanup, i.e. remove old files and only keep a 16 | /// given amount of (latest) files. 17 | /// 18 | /// Path to the directory to delete files within. 19 | /// Pattern that files (that should be cleaned up) must fulfill. 20 | /// Path to original database. This path will never be removed. 21 | /// 22 | /// Amount of latest files to keep for given path and searchPattern. If this value is omitted or a 23 | /// negative value is specified, the default "keepAmount" from the user configuration is taken. 24 | /// 25 | public static void Cleanup( 26 | string path, 27 | string searchPattern, 28 | string originalDatabasePath, 29 | int amountToKeep = -1 30 | ) { 31 | string[] fileList = Directory.GetFiles(path, searchPattern).OrderByDescending(f => new FileInfo(f).CreationTime).ToArray(); 32 | 33 | amountToKeep = amountToKeep < 0 ? (int) config.FileAmountToKeep : amountToKeep; 34 | RecycleOption recycleOption = config.UseRecycleBinDeletedBackups 35 | ? RecycleOption.SendToRecycleBin 36 | : RecycleOption.DeletePermanently; 37 | 38 | // if more backup files available than required delete the obsolete files 39 | if (fileList.Count() > amountToKeep) 40 | { 41 | for (int i = amountToKeep; i < fileList.Count(); i++) 42 | { 43 | // never delete original file -> always skip it (in case it made it into the filelist) 44 | if (fileList[i].Equals(originalDatabasePath)) 45 | { 46 | continue; 47 | } 48 | 49 | FileSystem.DeleteFile(fileList[i], UIOption.OnlyErrorDialogs, recycleOption); 50 | } 51 | } 52 | } 53 | 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /KPSimpleBackup/KPConfigBackupManager.cs: -------------------------------------------------------------------------------- 1 | using KeePassLib; 2 | using KeePassLib.Utility; 3 | using Microsoft.VisualBasic.FileIO; 4 | using System; 5 | using System.IO; 6 | 7 | namespace KPSimpleBackup 8 | { 9 | public class KPConfigBackupManager : BackupManager 10 | { 11 | private const string USER_BACKUP_SUFFIX = "backup-user-config_"; 12 | private const string APPLICATION_BACKUP_SUFFIX = "backup-application-config_"; 13 | 14 | protected override string ManagerName { get { return "KeePassConfigBackup"; } } 15 | 16 | public KPConfigBackupManager(PwDatabase database) : base(database) 17 | { 18 | // 19 | } 20 | 21 | protected override void PreBackup() 22 | { 23 | try 24 | { 25 | Directory.CreateDirectory(basePath); 26 | // ensure configuration is saved before backing it up 27 | KeePass.App.Configuration.AppConfigSerializer.Save(KeePass.Program.Config); 28 | } 29 | catch (Exception e) 30 | { 31 | pluginLogger.Log("Could not create backup directory!", KeePassLib.Interfaces.LogStatusType.Error); 32 | pluginLogger.Log("Exception: " + e.ToString(), KeePassLib.Interfaces.LogStatusType.AdditionalInfo); 33 | throw e; 34 | } 35 | } 36 | 37 | protected override void Backup() 38 | { 39 | try 40 | { 41 | CopyConfig(GetUserConfigPath(), USER_BACKUP_SUFFIX); 42 | CopyConfig(GetApplicationConfigPath(), APPLICATION_BACKUP_SUFFIX); 43 | } 44 | catch (Exception e) 45 | { 46 | pluginLogger.Log("Could not backup KeePass configuration file!", KeePassLib.Interfaces.LogStatusType.Error); 47 | pluginLogger.Log(e.ToString(), KeePassLib.Interfaces.LogStatusType.AdditionalInfo); 48 | } 49 | } 50 | 51 | /// 52 | /// Remove old/outdated config backups. 53 | /// 54 | protected override void Cleanup() 55 | { 56 | base.Cleanup(); 57 | 58 | string applicationConfigName = Path.GetFileName(GetApplicationConfigPath()); 59 | string userConfigName = Path.GetFileName(GetUserConfigPath()); 60 | 61 | string applicationDeletePattern = applicationConfigName + "." + APPLICATION_BACKUP_SUFFIX + "*"; 62 | string userDeletePattern = userConfigName + "." + USER_BACKUP_SUFFIX + "*"; 63 | 64 | string dbPath = database.IOConnectionInfo.Path; 65 | CleanupManager.Cleanup(basePath, applicationDeletePattern, dbPath); 66 | CleanupManager.Cleanup(basePath, userDeletePattern, dbPath); 67 | } 68 | 69 | /// 70 | /// Get User configuration path used by the main 71 | /// KeePass application to store the configuration file 72 | /// 73 | /// path to the user configuration file 74 | private string GetUserConfigPath() 75 | { 76 | string appDataDir = KeePass.App.Configuration.AppConfigSerializer.AppDataDirectory; 77 | return UrlUtil.EnsureTerminatingSeparator(appDataDir, false) + GetConfigFileName(); 78 | } 79 | 80 | /// 81 | /// Get Application configuration path stored in 82 | /// the same directory as the main KeePass application. 83 | /// This config is used by the portable KP version. 84 | /// 85 | /// path to the application config file 86 | private string GetApplicationConfigPath() 87 | { 88 | string curDir = Environment.CurrentDirectory; 89 | return UrlUtil.EnsureTerminatingSeparator(curDir, false) + GetConfigFileName(); 90 | } 91 | 92 | private string GetConfigFileName() 93 | { 94 | string strBaseDirName = PwDefs.ShortProductName; 95 | return strBaseDirName + ".config.xml"; 96 | } 97 | 98 | /// 99 | /// Copy a configuration file to the backup directory 100 | /// if it is available. 101 | /// 102 | /// path of the config file 103 | /// suffix to append to the backup-file-name 104 | private void CopyConfig(string configPath, string suffix) 105 | { 106 | if (! FileSystem.FileExists(configPath)) 107 | { 108 | pluginLogger.Log("Skipping path, no configuration found at: " + configPath, KeePassLib.Interfaces.LogStatusType.Info); 109 | return; 110 | } 111 | 112 | string time = GenerateUserConfiguredTimeString(); 113 | string configFileName = Path.GetFileName(configPath); 114 | string backupConfigPath = FILE_PREFIX + basePath + configFileName + "." + suffix + time; 115 | backupConfigPath = new Uri(backupConfigPath).LocalPath; 116 | 117 | pluginLogger.Log("Copy " + configPath + " to " + backupConfigPath, KeePassLib.Interfaces.LogStatusType.Info); 118 | FileSystem.CopyFile(configPath, backupConfigPath, true); 119 | } 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /KPSimpleBackup/KPSimpleBackup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.Windows.Forms; 4 | using KeePass.Forms; 5 | using KeePass.Plugins; 6 | using KeePassLib; 7 | using KeePassLib.Utility; 8 | using KeePassLib.Interfaces; 9 | 10 | namespace KPSimpleBackup 11 | { 12 | public sealed class KPSimpleBackupExt : Plugin 13 | { 14 | private IPluginHost m_host = null; 15 | private KPSimpleBackupConfig m_config = null; 16 | private Logger m_PluginLogger = null; 17 | 18 | /// 19 | /// This flag keeps track of whether the database has been modified 20 | /// since the last backup, or not. 21 | /// 22 | private bool m_databaseModifiedAfterLastBackup = false; 23 | 24 | public override bool Initialize(IPluginHost host) 25 | { 26 | if (host == null) return false; 27 | 28 | m_host = host; 29 | m_config = new KPSimpleBackupConfig(m_host.CustomConfig); 30 | m_PluginLogger = new Logger(m_config.LogToFile); 31 | 32 | BackupManager.SetConfig(m_config); 33 | BackupManager.SetPluginLogger(m_PluginLogger); 34 | CleanupManager.config = m_config; 35 | 36 | // add handler for KeePass events this plugin reacts to (file saving, closing, etc.) 37 | m_host.MainWindow.FileSaving += this.OnDatabaseSavingPreAction; 38 | m_host.MainWindow.FileSaved += this.OnDatabaseSaveAction; 39 | m_host.MainWindow.FileClosingPost += this.OnDatabaseCloseAction; 40 | 41 | // initialization successful 42 | return true; 43 | } 44 | 45 | public override void Terminate() 46 | { 47 | // Remove event handlers 48 | m_host.MainWindow.FileSaving -= this.OnDatabaseSavingPreAction; 49 | m_host.MainWindow.FileSaved -= this.OnDatabaseSaveAction; 50 | m_host.MainWindow.FileClosingPost -= this.OnDatabaseCloseAction; 51 | 52 | m_PluginLogger.Terminate(); 53 | } 54 | 55 | public override string UpdateUrl 56 | { 57 | get 58 | { 59 | return "https://raw.githubusercontent.com/marvinweber/KPSimpleBackup/main/kpsimplebackup.version"; 60 | } 61 | } 62 | 63 | public override ToolStripMenuItem GetMenuItem(PluginMenuType t) 64 | { 65 | // Provide a menu item for the main location(s) 66 | if (t == PluginMenuType.Main) 67 | { 68 | ToolStripMenuItem tsmi = new ToolStripMenuItem(); 69 | 70 | tsmi.Text = "KPSimpleBackup"; 71 | 72 | ToolStripMenuItem backupNowItem = new ToolStripMenuItem(); 73 | backupNowItem.Text = "Backup Database now!"; 74 | backupNowItem.Click += this.OnMenuBackupNow; 75 | 76 | ToolStripMenuItem openSettings = new ToolStripMenuItem(); 77 | openSettings.Text = "Settings"; 78 | openSettings.Click += this.OnMenuSettings; 79 | 80 | ToolStripMenuItem openLog = new ToolStripMenuItem(); 81 | openLog.Text = "Open Session Log"; 82 | openLog.Click += this.OnMenuShowLog; 83 | 84 | 85 | tsmi.DropDownItems.Add(backupNowItem); 86 | tsmi.DropDownItems.Add(openSettings); 87 | tsmi.DropDownItems.Add(openLog); 88 | 89 | return tsmi; 90 | } 91 | 92 | return null; // No menu items in other locations 93 | } 94 | 95 | private void OnMenuSettings(object sender, EventArgs e) 96 | { 97 | SettingsForm settingsWindow = new SettingsForm(this.m_config); 98 | settingsWindow.ShowDialog(); 99 | settingsWindow.Dispose(); 100 | settingsWindow = null; 101 | } 102 | 103 | private void OnMenuShowLog(object sender, EventArgs e) 104 | { 105 | LogForm logForm = new LogForm(this.m_PluginLogger); 106 | logForm.ShowDialog(); 107 | logForm.Dispose(); 108 | } 109 | 110 | /// 111 | /// Handler to be called before the KeePass Database is saved. It checks 112 | /// whether the database has been modified and updates the internal flag 113 | /// of this class accordingly. 114 | /// 115 | /// 116 | /// 117 | private void OnDatabaseSavingPreAction(object sender, FileSavingEventArgs e) 118 | { 119 | m_databaseModifiedAfterLastBackup = m_databaseModifiedAfterLastBackup || e.Database.Modified; 120 | } 121 | 122 | private void OnDatabaseSaveAction(object sender, FileSavedEventArgs e) 123 | { 124 | // only create backup if auto-backup is enabled 125 | if (this.m_config.AutoDatabaseBackup) 126 | { 127 | this.BackupAction(e.Database); 128 | } 129 | } 130 | 131 | /// 132 | /// Handler to be called whenever the database is closed (i.e., it is called 133 | /// when the database is locked, closed or KeePass is closed). 134 | /// If enabled by the user ("backup-on-close") and the database is opened and 135 | /// modified (or was modified and saved after the last backup), a backup will 136 | /// be triggered. 137 | /// 138 | /// 139 | /// File closing event containing the database object 140 | private void OnDatabaseCloseAction(object sender, FileClosingEventArgs e) 141 | { 142 | // perform backup if "backup-on-close" is configured and database is opened 143 | // and modified (or was modified and saved since the last backup) as well 144 | // (prevent backups of unmodified database) 145 | if ( 146 | this.m_config.BackupOnDbClose && 147 | e.Database.IsOpen && 148 | (e.Database.Modified || m_databaseModifiedAfterLastBackup) 149 | ) { 150 | this.BackupAction(e.Database); 151 | } 152 | } 153 | 154 | private void OnMenuBackupNow(object sender, EventArgs e) 155 | { 156 | // show warning and return if configuration isn't finished 157 | if (!this.m_config.BackupConfigured) 158 | { 159 | MessageService.ShowWarning( 160 | "Database backup cannot be created, because the configuration is not finished.", 161 | "Please goto \"Tools -> KPSimpleBackup -> Settings\" and add a backup folder!" 162 | ); 163 | return; 164 | } 165 | this.BackupAction(m_host.Database); 166 | } 167 | 168 | private void BackupAction(PwDatabase database) 169 | { 170 | // don't perform backup if configuration isn't finished 171 | if (!this.m_config.BackupConfigured) 172 | { 173 | return; 174 | } 175 | 176 | // start stopwatch to measure time needed for the backup 177 | Stopwatch stopWatch = new Stopwatch(); 178 | stopWatch.Start(); 179 | 180 | IStatusLogger swLogger = this.m_host.MainWindow.CreateShowWarningsLogger(); 181 | try 182 | { 183 | m_host.MainWindow.UIBlockInteraction(true); 184 | bool warnings = false; 185 | 186 | BackupManager.SetKPMainWindowSwLogger(swLogger); 187 | swLogger.SetText("KPSimpleBackup: Backup started...", LogStatusType.Info); 188 | m_PluginLogger.Log("KPSimpleBackup: Backup started...", LogStatusType.Info); 189 | 190 | BasicBackupManager basicBackupManager = new BasicBackupManager(database); 191 | warnings = ! basicBackupManager.Run() || warnings; 192 | 193 | // perform long term backup if enabled in settings 194 | if (m_config.UseLongTermBackup) 195 | { 196 | LongTermBackupManager ltbManager = new LongTermBackupManager(database); 197 | if (basicBackupManager.lastBackupFilePath != null) 198 | { 199 | ltbManager.SetTempDatabaseBackupFile(basicBackupManager.lastBackupFilePath); 200 | } 201 | warnings = ! ltbManager.Run() || warnings; 202 | } 203 | 204 | // reset database modified property, as an up-to-date backup has now been created 205 | m_databaseModifiedAfterLastBackup = false; 206 | 207 | // backup KeePass configuration if enabled in settings 208 | if (m_config.BackupKeePassConfig) 209 | { 210 | KPConfigBackupManager kPConfigBackupManager = new KPConfigBackupManager(database); 211 | warnings = ! kPConfigBackupManager.Run() || warnings; 212 | } 213 | 214 | if (warnings) 215 | { 216 | swLogger.SetText("KPSimpleBackup: Backup finished with warnings, consider checking the logs!", LogStatusType.Info); 217 | if (m_config.ShowBackupFailedWarning) 218 | { 219 | MessageService.ShowWarning( 220 | "KPSimpleBackup: Backup finished with warnings, check the logs for details!" 221 | ); 222 | } 223 | } 224 | else 225 | { 226 | swLogger.SetText("KPSimpleBackup: Backup finished!", LogStatusType.Info); 227 | } 228 | } 229 | catch (Exception e) 230 | { 231 | swLogger.EndLogging(); 232 | swLogger.SetText("KPSimpleBackup: Backup failed, see logs for details!", LogStatusType.Error); 233 | 234 | m_PluginLogger.Log("Could not backup database! Error:", LogStatusType.Error); 235 | m_PluginLogger.Log(e.ToString(), LogStatusType.Error); 236 | } 237 | finally 238 | { 239 | m_host.MainWindow.UIBlockInteraction(false); 240 | stopWatch.Stop(); 241 | m_PluginLogger.Log("KPSimpleBackup: Finished in " + stopWatch.ElapsedMilliseconds + " ms.", LogStatusType.Info); 242 | } 243 | } 244 | } 245 | } -------------------------------------------------------------------------------- /KPSimpleBackup/KPSimpleBackup.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {90AE5E95-FAC2-46D6-8B6B-BAB535323BB1} 8 | Library 9 | Properties 10 | KPSimpleBackup 11 | KPSimpleBackup 12 | v4.6.1 13 | 512 14 | true 15 | 16 | 17 | 18 | 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | 27 | 28 | pdbonly 29 | true 30 | bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 35 | 36 | 37 | C:\Program Files (x86)\KeePass Password Safe 2\KeePass.exe 38 | 39 | 40 | 41 | ..\packages\Ookii.Dialogs.WinForms.1.1.0\lib\net45\Ookii.Dialogs.WinForms.dll 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | Form 65 | 66 | 67 | LogForm.cs 68 | 69 | 70 | 71 | 72 | 73 | True 74 | True 75 | Settings.settings 76 | 77 | 78 | Form 79 | 80 | 81 | SettingsForm.cs 82 | 83 | 84 | 85 | 86 | 87 | 88 | SettingsSingleFileGenerator 89 | Settings.Designer.cs 90 | 91 | 92 | 93 | 94 | LogForm.cs 95 | 96 | 97 | SettingsForm.cs 98 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /KPSimpleBackup/KPSimpleBackupConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using KeePass.App.Configuration; 5 | 6 | namespace KPSimpleBackup 7 | { 8 | public class KPSimpleBackupConfig 9 | { 10 | private AceCustomConfig customConfig; 11 | 12 | // default config values 13 | private static readonly string DEFAULT_BACKUP_FILE_EXTENSION = ".kdbx"; 14 | private static readonly bool DEFAULT_SHOW_BACKUP_FAILED_WARNING = true; 15 | private static readonly bool DEFAULT_LOG_TO_FILE = false; 16 | private static readonly long DEFAULT_FILE_AMOUNT_TO_KEEP = 15; 17 | private static readonly bool DEFAULT_USE_DATABASE_NAMES_FOR_BACKUP_FILES = false; 18 | private static readonly bool DEFAULT_USE_RECYCLE_BIN_DELETED_BACKUPS = true; 19 | private static readonly bool DEFAULT_AUTO_BACKUP_DATABASE = true; 20 | private static readonly bool DEFAULT_BACKUP_ON_DB_CLOSE = false; 21 | private static readonly bool DEFAULT_USE_LONG_TERM_BACKUP = false; 22 | private static readonly long DEFAULT_LTB_WEEKLY_AMOUNT = 4; 23 | private static readonly long DEFAULT_LTB_MONTHLY_AMOUNT = 12; 24 | private static readonly long DEFAULT_LTB_YEARLY_AMOUNT = 1000; 25 | private static readonly bool DEFAULT_BACKUP_KEEPASS_CONFIG = false; 26 | private static readonly string DEFAULT_DATE_FORMAT = "yyyy.MM.dd_H.mm.ss"; 27 | private static readonly String EMPTY_STRING = ""; 28 | private static readonly char PATH_SEPERATOR = ';'; 29 | 30 | public KPSimpleBackupConfig(AceCustomConfig customConfig) 31 | { 32 | this.customConfig = customConfig; 33 | } 34 | 35 | public bool BackupConfigured 36 | { 37 | get 38 | { 39 | List paths = this.BackupPath; 40 | return !(paths.Count == 0 || paths[0] == EMPTY_STRING); 41 | } 42 | } 43 | 44 | public bool ShowBackupFailedWarning 45 | { 46 | get 47 | { 48 | return this.customConfig.GetBool("KPSimpleBackupConfig_showBackupFailedWarning", DEFAULT_SHOW_BACKUP_FAILED_WARNING); 49 | } 50 | 51 | set 52 | { 53 | this.customConfig.SetBool("KPSimpleBackupConfig_showBackupFailedWarning", value); 54 | } 55 | } 56 | 57 | public bool LogToFile 58 | { 59 | get 60 | { 61 | return this.customConfig.GetBool("KPSimpleBackupConfig_logToFile", DEFAULT_LOG_TO_FILE); 62 | } 63 | 64 | set 65 | { 66 | this.customConfig.SetBool("KPSimpleBackupConfig_logToFile", value); 67 | } 68 | } 69 | 70 | public List BackupPath 71 | { 72 | get 73 | { 74 | String paths = this.customConfig.GetString("KPSimpleBackupConfig_backupPath", EMPTY_STRING); 75 | return paths.Split(PATH_SEPERATOR).ToList(); 76 | } 77 | 78 | set 79 | { 80 | String paths = String.Join(Char.ToString(PATH_SEPERATOR), value.ToArray()); 81 | this.customConfig.SetString("KPSimpleBackupConfig_backupPath", paths); 82 | } 83 | } 84 | 85 | public string BackupFileExtension 86 | { 87 | get 88 | { 89 | return this.customConfig.GetString("KPSimpleBackupConfig_backupFileExtension", DEFAULT_BACKUP_FILE_EXTENSION); 90 | } 91 | 92 | set 93 | { 94 | this.customConfig.SetString("KPSimpleBackupConfig_backupFileExtension", value); 95 | } 96 | } 97 | 98 | public bool UseCustomBackupFileExtension 99 | { 100 | get 101 | { 102 | return this.customConfig.GetBool("KPSimpleBackupConfig_useCustomBackupFileExtension", false); 103 | } 104 | 105 | set 106 | { 107 | this.customConfig.SetBool("KPSimpleBackupConfig_useCustomBackupFileExtension", value); 108 | } 109 | } 110 | 111 | public long FileAmountToKeep 112 | { 113 | get 114 | { 115 | return this.customConfig.GetLong("KPSimpleBackupConfig_fileAmountToKeep", DEFAULT_FILE_AMOUNT_TO_KEEP); 116 | } 117 | 118 | set 119 | { 120 | this.customConfig.SetLong("KPSimpleBackupConfig_fileAmountToKeep", value); 121 | } 122 | } 123 | 124 | public bool UseDatabaseNameForBackupFiles 125 | { 126 | get 127 | { 128 | return this.customConfig.GetBool("KPSimpleBackupConfig_useDatabaseNameForBackupFiles", DEFAULT_USE_DATABASE_NAMES_FOR_BACKUP_FILES); 129 | } 130 | 131 | set 132 | { 133 | this.customConfig.SetBool("KPSimpleBackupConfig_useDatabaseNameForBackupFiles", value); 134 | } 135 | } 136 | 137 | public bool UseRecycleBinDeletedBackups 138 | { 139 | get 140 | { 141 | return this.customConfig.GetBool("KPSimpleBackupConfig_useRecycleBinDeletedBackups", DEFAULT_USE_RECYCLE_BIN_DELETED_BACKUPS); 142 | } 143 | 144 | set 145 | { 146 | this.customConfig.SetBool("KPSimpleBackupConfig_useRecycleBinDeletedBackups", value); 147 | } 148 | } 149 | 150 | public bool AutoDatabaseBackup 151 | { 152 | get 153 | { 154 | return this.customConfig.GetBool("KPSimpleBackupConfig_autoDatabaseBackup", DEFAULT_AUTO_BACKUP_DATABASE); 155 | } 156 | 157 | set 158 | { 159 | this.customConfig.SetBool("KPSimpleBackupConfig_autoDatabaseBackup", value); 160 | } 161 | } 162 | 163 | public bool BackupOnDbClose 164 | { 165 | get 166 | { 167 | return this.customConfig.GetBool("KPSimpleBackupConfig_backupOnDbClose", DEFAULT_BACKUP_ON_DB_CLOSE); 168 | } 169 | 170 | set 171 | { 172 | this.customConfig.SetBool("KPSimpleBackupConfig_backupOnDbClose", value); 173 | } 174 | } 175 | 176 | public bool UseLongTermBackup 177 | { 178 | get 179 | { 180 | return this.customConfig.GetBool("KPSimpleBackupConfig_useLongTermBackup", DEFAULT_USE_LONG_TERM_BACKUP); 181 | } 182 | 183 | set 184 | { 185 | this.customConfig.SetBool("KPSimpleBackupConfig_useLongTermBackup", value); 186 | } 187 | } 188 | 189 | public int LtbWeeklyAmount 190 | { 191 | get 192 | { 193 | return (int) this.customConfig.GetLong("KPSimpleBackupConfig_ltbWeeklyAmount", DEFAULT_LTB_WEEKLY_AMOUNT); 194 | } 195 | 196 | set 197 | { 198 | this.customConfig.SetLong("KPSimpleBackupConfig_ltbWeeklyAmount", value); 199 | } 200 | } 201 | 202 | public int LtbMonthlyAmount 203 | { 204 | get 205 | { 206 | return (int)this.customConfig.GetLong("KPSimpleBackupConfig_ltbMonthlyAmount", DEFAULT_LTB_MONTHLY_AMOUNT); 207 | } 208 | 209 | set 210 | { 211 | this.customConfig.SetLong("KPSimpleBackupConfig_ltbMonthlyAmount", value); 212 | } 213 | } 214 | 215 | public int LtbYearlyAmount 216 | { 217 | get 218 | { 219 | return (int)this.customConfig.GetLong("KPSimpleBackupConfig_ltbYearlyAmount", DEFAULT_LTB_YEARLY_AMOUNT); 220 | } 221 | 222 | set 223 | { 224 | this.customConfig.SetLong("KPSimpleBackupConfig_ltbYearlyAmount", value); 225 | } 226 | } 227 | 228 | public bool BackupKeePassConfig 229 | { 230 | get 231 | { 232 | return this.customConfig.GetBool("KPSimpleBackupConfig_backupKeePassConfig", DEFAULT_BACKUP_KEEPASS_CONFIG); 233 | } 234 | 235 | set 236 | { 237 | this.customConfig.SetBool("KPSimpleBackupConfig_backupKeePassConfig", value); 238 | } 239 | } 240 | 241 | public string DateFormat 242 | { 243 | get 244 | { 245 | return this.customConfig.GetString("KPSimpleBackupConfig_dateFormat", DEFAULT_DATE_FORMAT); 246 | } 247 | 248 | set 249 | { 250 | this.customConfig.SetString("KPSimpleBackupConfig_dateFormat", value); 251 | } 252 | } 253 | } 254 | } 255 | -------------------------------------------------------------------------------- /KPSimpleBackup/LogForm.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace KPSimpleBackup 2 | { 3 | partial class LogForm 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.listBoxLog = new System.Windows.Forms.ListBox(); 32 | this.buttonCopyAllEntries = new System.Windows.Forms.Button(); 33 | this.buttonCopySelectedEntries = new System.Windows.Forms.Button(); 34 | this.SuspendLayout(); 35 | // 36 | // listBoxLog 37 | // 38 | this.listBoxLog.FormattingEnabled = true; 39 | this.listBoxLog.HorizontalScrollbar = true; 40 | this.listBoxLog.Location = new System.Drawing.Point(12, 8); 41 | this.listBoxLog.Name = "listBoxLog"; 42 | this.listBoxLog.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended; 43 | this.listBoxLog.Size = new System.Drawing.Size(1033, 524); 44 | this.listBoxLog.TabIndex = 0; 45 | // 46 | // buttonCopyAllEntries 47 | // 48 | this.buttonCopyAllEntries.Location = new System.Drawing.Point(892, 543); 49 | this.buttonCopyAllEntries.Name = "buttonCopyAllEntries"; 50 | this.buttonCopyAllEntries.Size = new System.Drawing.Size(153, 23); 51 | this.buttonCopyAllEntries.TabIndex = 1; 52 | this.buttonCopyAllEntries.Text = "Copy all entries to clipboard"; 53 | this.buttonCopyAllEntries.UseVisualStyleBackColor = true; 54 | this.buttonCopyAllEntries.Click += new System.EventHandler(this.ButtonCopyAllEntries_Click); 55 | // 56 | // buttonCopySelectedEntries 57 | // 58 | this.buttonCopySelectedEntries.Location = new System.Drawing.Point(698, 543); 59 | this.buttonCopySelectedEntries.Name = "buttonCopySelectedEntries"; 60 | this.buttonCopySelectedEntries.Size = new System.Drawing.Size(188, 23); 61 | this.buttonCopySelectedEntries.TabIndex = 2; 62 | this.buttonCopySelectedEntries.Text = "Copy selected entries to clipboard"; 63 | this.buttonCopySelectedEntries.UseVisualStyleBackColor = true; 64 | this.buttonCopySelectedEntries.Click += new System.EventHandler(this.ButtonCopySelectedEntries_Click); 65 | // 66 | // LogForm 67 | // 68 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 69 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 70 | this.ClientSize = new System.Drawing.Size(1057, 578); 71 | this.Controls.Add(this.buttonCopySelectedEntries); 72 | this.Controls.Add(this.buttonCopyAllEntries); 73 | this.Controls.Add(this.listBoxLog); 74 | this.Cursor = System.Windows.Forms.Cursors.Default; 75 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; 76 | this.MaximizeBox = false; 77 | this.MinimizeBox = false; 78 | this.Name = "LogForm"; 79 | this.ShowIcon = false; 80 | this.ShowInTaskbar = false; 81 | this.Text = "Session Log"; 82 | this.ResumeLayout(false); 83 | 84 | } 85 | 86 | #endregion 87 | 88 | private System.Windows.Forms.ListBox listBoxLog; 89 | private System.Windows.Forms.Button buttonCopyAllEntries; 90 | private System.Windows.Forms.Button buttonCopySelectedEntries; 91 | } 92 | } -------------------------------------------------------------------------------- /KPSimpleBackup/LogForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | 11 | namespace KPSimpleBackup 12 | { 13 | public partial class LogForm : Form 14 | { 15 | private Logger logger; 16 | 17 | public LogForm(Logger logger) 18 | { 19 | this.logger = logger; 20 | 21 | InitializeComponent(); 22 | 23 | listBoxLog.DataSource = this.logger.GetLog(); 24 | } 25 | 26 | private void ButtonCopyAllEntries_Click(object sender, EventArgs e) 27 | { 28 | // set all items selected 29 | for (int i = 0; i < listBoxLog.Items.Count; i++) 30 | { 31 | listBoxLog.SetSelected(i, true); 32 | } 33 | // copy them to clipboard 34 | this.CopySelectedLogItemsToClipboard(); 35 | } 36 | 37 | private void ButtonCopySelectedEntries_Click(object sender, EventArgs e) 38 | { 39 | this.CopySelectedLogItemsToClipboard(); 40 | } 41 | 42 | private void CopySelectedLogItemsToClipboard() 43 | { 44 | string s = ""; 45 | foreach (object o in listBoxLog.SelectedItems) 46 | { 47 | s += o.ToString() + "\r\n"; 48 | } 49 | Clipboard.SetText(s); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /KPSimpleBackup/LogForm.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /KPSimpleBackup/Logger.cs: -------------------------------------------------------------------------------- 1 | using KeePassLib.Interfaces; 2 | using KeePassLib.Utility; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.IO; 6 | 7 | namespace KPSimpleBackup 8 | { 9 | public class Logger 10 | { 11 | private const string LOG_FILE_NAME = "kpsimplebackup.log.txt"; 12 | 13 | private List currentLog; 14 | private StreamWriter streamWriter; 15 | private bool writeToFile; 16 | 17 | public Logger(bool writeToFile) 18 | { 19 | currentLog = new List(); 20 | 21 | this.writeToFile = writeToFile; 22 | if (writeToFile) 23 | { 24 | string path = UrlUtil.EnsureTerminatingSeparator(KeePass.App.Configuration.AppConfigSerializer.AppDataDirectory, false); 25 | Directory.CreateDirectory(path); 26 | streamWriter = File.AppendText(path + LOG_FILE_NAME); 27 | } 28 | } 29 | 30 | public List GetLog() 31 | { 32 | return this.currentLog; 33 | } 34 | 35 | /// 36 | /// Log function for the KPSimpleBackup plugin. It should be used only 37 | /// by KPSimpleBackup, since it puts the plugin name in front of each 38 | /// log line. 39 | /// 40 | /// Text that will be logged 41 | /// Status Type 42 | public void Log(string text, LogStatusType lsType) 43 | { 44 | StoreLine("[KPSimpleBackup] [" + lsType + "] " + text); 45 | } 46 | 47 | public void Terminate() 48 | { 49 | if (writeToFile) 50 | { 51 | streamWriter.Flush(); 52 | streamWriter.Close(); 53 | } 54 | } 55 | 56 | private void StoreLine(string text) 57 | { 58 | string line = "[" + DateTime.Now.ToString() + "] " + text; 59 | 60 | currentLog.Add(line); 61 | if (writeToFile) 62 | { 63 | streamWriter.WriteLine(line); 64 | } 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /KPSimpleBackup/LongTermBackupManager.cs: -------------------------------------------------------------------------------- 1 | using KeePassLib; 2 | using Microsoft.VisualBasic.FileIO; 3 | using System; 4 | using System.Globalization; 5 | using System.IO; 6 | 7 | namespace KPSimpleBackup 8 | { 9 | public class LongTermBackupManager : BackupManager 10 | { 11 | protected override string ManagerName { get { return "LongTermBackup"; } } 12 | 13 | private const string LTB_FOLDER_SUFFIX = "_long-term-backups"; 14 | private const string LTB_FOLDER_WEEKLY = "weekly"; 15 | private const string LTB_FOLDER_MONTHLY = "monthly"; 16 | private const string LTB_FOLDER_YEARLY = "yearly"; 17 | 18 | private string basePathWeekly; 19 | private string basePathMonthly; 20 | private string basePathYearly; 21 | 22 | private string weekOfYear; 23 | private string monthOfYear; 24 | private int year; 25 | 26 | public LongTermBackupManager(PwDatabase database) : base(database) 27 | { 28 | DateTimeFormatInfo dfi = DateTimeFormatInfo.CurrentInfo; 29 | System.DateTime now = System.DateTime.Now; 30 | Calendar cal = dfi.Calendar; 31 | 32 | // get current date information 33 | weekOfYear = cal.GetWeekOfYear(now, dfi.CalendarWeekRule, dfi.FirstDayOfWeek).ToString("00"); 34 | monthOfYear = cal.GetMonth(now).ToString("00"); 35 | year = cal.GetYear(now); 36 | } 37 | 38 | protected override void PreBackup() 39 | { 40 | basePathWeekly = basePath + dbFileName + LTB_FOLDER_SUFFIX + "/" + LTB_FOLDER_WEEKLY + "/"; 41 | basePathMonthly = basePath + dbFileName + LTB_FOLDER_SUFFIX + "/" + LTB_FOLDER_MONTHLY + "/"; 42 | basePathYearly = basePath + dbFileName + LTB_FOLDER_SUFFIX + "/" + LTB_FOLDER_YEARLY + "/"; 43 | 44 | try 45 | { 46 | Directory.CreateDirectory(basePathWeekly); 47 | Directory.CreateDirectory(basePathMonthly); 48 | Directory.CreateDirectory(basePathYearly); 49 | } 50 | catch (Exception e) 51 | { 52 | pluginLogger.Log("Could not create backup directories!", KeePassLib.Interfaces.LogStatusType.Error); 53 | pluginLogger.Log("Exception: " + e.ToString(), KeePassLib.Interfaces.LogStatusType.AdditionalInfo); 54 | throw e; 55 | } 56 | } 57 | 58 | protected override void Backup() 59 | { 60 | // create paths for all files 61 | string pathWeekly = FILE_PREFIX + basePathWeekly + dbFileName + "_" + year + "-" + weekOfYear + dbFileExtension; 62 | string pathMonthly = FILE_PREFIX + basePathMonthly + dbFileName + "_" + year + "-" + monthOfYear + dbFileExtension; 63 | string pathYearly = FILE_PREFIX + basePathYearly + dbFileName + "_" + year + dbFileExtension; 64 | System.Collections.ArrayList backupPaths = new System.Collections.ArrayList { 65 | pathWeekly, 66 | pathMonthly, 67 | pathYearly 68 | }; 69 | 70 | // perform backup for all files (i.e., LTB locations) 71 | foreach (string backupPath in backupPaths) 72 | { 73 | CopyPwDatabaseFileToPath(backupPath); 74 | } 75 | } 76 | 77 | protected override void Cleanup() 78 | { 79 | base.Cleanup(); 80 | 81 | string searchPattern = dbFileName + "_*" + dbFileExtension; 82 | 83 | CleanupManager.Cleanup(basePathWeekly, searchPattern, database.IOConnectionInfo.Path, config.LtbWeeklyAmount); 84 | CleanupManager.Cleanup(basePathMonthly, searchPattern, database.IOConnectionInfo.Path, config.LtbMonthlyAmount); 85 | CleanupManager.Cleanup(basePathYearly, searchPattern, database.IOConnectionInfo.Path, config.LtbYearlyAmount); 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /KPSimpleBackup/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Resources; 2 | using System.Reflection; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | 6 | // Allgemeine Informationen über eine Assembly werden über die folgenden 7 | // Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, 8 | // die einer Assembly zugeordnet sind. 9 | [assembly: AssemblyTitle("KPSimpleBackup")] 10 | [assembly: AssemblyDescription("Simple Plugin for KeePass-Backups (compatible with the IOProtocol Plugin)")] 11 | [assembly: AssemblyConfiguration("")] 12 | [assembly: AssemblyCompany("Marvin Weber (marvinweber.net)")] 13 | [assembly: AssemblyProduct("KeePass Plugin")] 14 | [assembly: AssemblyCopyright("Copyright © 2019 - 2021 | Marvin Weber")] 15 | [assembly: AssemblyTrademark("")] 16 | [assembly: AssemblyCulture("")] 17 | 18 | // Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly 19 | // für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von 20 | // COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen. 21 | [assembly: ComVisible(false)] 22 | 23 | // Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird 24 | [assembly: Guid("90ae5e95-fac2-46d6-8b6b-bab535323bb1")] 25 | 26 | // Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: 27 | // 28 | // Hauptversion 29 | // Nebenversion 30 | // Buildnummer 31 | // Revision 32 | // 33 | // Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, 34 | // indem Sie "*" wie unten gezeigt eingeben: 35 | // [assembly: AssemblyVersion("1.0.*")] 36 | [assembly: AssemblyVersion("1.4.0")] 37 | [assembly: AssemblyFileVersion("1.4.0")] 38 | [assembly: NeutralResourcesLanguage("en")] 39 | 40 | -------------------------------------------------------------------------------- /KPSimpleBackup/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // Dieser Code wurde von einem Tool generiert. 4 | // Laufzeitversion:4.0.30319.42000 5 | // 6 | // Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn 7 | // der Code erneut generiert wird. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace KPSimpleBackup.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /KPSimpleBackup/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /KPSimpleBackup/SettingsForm.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace KPSimpleBackup 2 | { 3 | partial class SettingsForm 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.Windows.Forms.LinkLabel linkLabelRessourcesOokiDialogsWebsite; 32 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SettingsForm)); 33 | this.panel1 = new System.Windows.Forms.Panel(); 34 | this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); 35 | this.label15 = new System.Windows.Forms.Label(); 36 | this.label1 = new System.Windows.Forms.Label(); 37 | this.numericNumberOfBackups = new System.Windows.Forms.NumericUpDown(); 38 | this.label2 = new System.Windows.Forms.Label(); 39 | this.panel2 = new System.Windows.Forms.Panel(); 40 | this.buttonRemoveSelectedFolder = new System.Windows.Forms.Button(); 41 | this.listBoxBackupPaths = new System.Windows.Forms.ListBox(); 42 | this.buttonAddFolder = new System.Windows.Forms.Button(); 43 | this.label5 = new System.Windows.Forms.Label(); 44 | this.panel3 = new System.Windows.Forms.Panel(); 45 | this.buttonDateFormatHelp = new System.Windows.Forms.Button(); 46 | this.textBoxDateFormat = new System.Windows.Forms.TextBox(); 47 | this.panel4 = new System.Windows.Forms.Panel(); 48 | this.checkBoxBackupKeePassConfig = new System.Windows.Forms.CheckBox(); 49 | this.buttonSave = new System.Windows.Forms.Button(); 50 | this.checkBoxUseDbName = new System.Windows.Forms.CheckBox(); 51 | this.tabControlSettings = new System.Windows.Forms.TabControl(); 52 | this.tabPage1 = new System.Windows.Forms.TabPage(); 53 | this.tabPage2 = new System.Windows.Forms.TabPage(); 54 | this.checkBoxShowBackupFailedWarning = new System.Windows.Forms.CheckBox(); 55 | this.textBoxRelativeBackupPath = new System.Windows.Forms.TextBox(); 56 | this.buttonRelativeBackupPathHelp = new System.Windows.Forms.Button(); 57 | this.buttonRelativeBackupPathAdd = new System.Windows.Forms.Button(); 58 | this.numericUpDownLtbYearly = new System.Windows.Forms.NumericUpDown(); 59 | this.numericUpDownLtbMonthly = new System.Windows.Forms.NumericUpDown(); 60 | this.numericUpDownLtbWeekly = new System.Windows.Forms.NumericUpDown(); 61 | this.label14 = new System.Windows.Forms.Label(); 62 | this.label13 = new System.Windows.Forms.Label(); 63 | this.label12 = new System.Windows.Forms.Label(); 64 | this.label11 = new System.Windows.Forms.Label(); 65 | this.label10 = new System.Windows.Forms.Label(); 66 | this.label9 = new System.Windows.Forms.Label(); 67 | this.label8 = new System.Windows.Forms.Label(); 68 | this.checkBoxEnableLongTermBackups = new System.Windows.Forms.CheckBox(); 69 | this.checkBoxBackupOnDbClose = new System.Windows.Forms.CheckBox(); 70 | this.textBoxBackupFileEnding = new System.Windows.Forms.TextBox(); 71 | this.checkBoxCustomFileEnding = new System.Windows.Forms.CheckBox(); 72 | this.checkBoxAutoBackup = new System.Windows.Forms.CheckBox(); 73 | this.checkBoxUseRecycleBin = new System.Windows.Forms.CheckBox(); 74 | this.tabPage3 = new System.Windows.Forms.TabPage(); 75 | this.linkLabelRessourcesOokiDialogsGitHub = new System.Windows.Forms.LinkLabel(); 76 | this.label7 = new System.Windows.Forms.Label(); 77 | this.label6 = new System.Windows.Forms.Label(); 78 | this.linkLabelReportBug = new System.Windows.Forms.LinkLabel(); 79 | this.labelVersion = new System.Windows.Forms.Label(); 80 | this.label4 = new System.Windows.Forms.Label(); 81 | linkLabelRessourcesOokiDialogsWebsite = new System.Windows.Forms.LinkLabel(); 82 | this.panel1.SuspendLayout(); 83 | this.tableLayoutPanel1.SuspendLayout(); 84 | ((System.ComponentModel.ISupportInitialize)(this.numericNumberOfBackups)).BeginInit(); 85 | this.panel2.SuspendLayout(); 86 | this.panel3.SuspendLayout(); 87 | this.panel4.SuspendLayout(); 88 | this.tabControlSettings.SuspendLayout(); 89 | this.tabPage1.SuspendLayout(); 90 | this.tabPage2.SuspendLayout(); 91 | ((System.ComponentModel.ISupportInitialize)(this.numericUpDownLtbYearly)).BeginInit(); 92 | ((System.ComponentModel.ISupportInitialize)(this.numericUpDownLtbMonthly)).BeginInit(); 93 | ((System.ComponentModel.ISupportInitialize)(this.numericUpDownLtbWeekly)).BeginInit(); 94 | this.tabPage3.SuspendLayout(); 95 | this.SuspendLayout(); 96 | // 97 | // linkLabelRessourcesOokiDialogsWebsite 98 | // 99 | linkLabelRessourcesOokiDialogsWebsite.ActiveLinkColor = System.Drawing.Color.DarkRed; 100 | linkLabelRessourcesOokiDialogsWebsite.AutoSize = true; 101 | linkLabelRessourcesOokiDialogsWebsite.LinkColor = System.Drawing.Color.DarkRed; 102 | linkLabelRessourcesOokiDialogsWebsite.Location = new System.Drawing.Point(54, 166); 103 | linkLabelRessourcesOokiDialogsWebsite.Name = "linkLabelRessourcesOokiDialogsWebsite"; 104 | linkLabelRessourcesOokiDialogsWebsite.Size = new System.Drawing.Size(46, 13); 105 | linkLabelRessourcesOokiDialogsWebsite.TabIndex = 6; 106 | linkLabelRessourcesOokiDialogsWebsite.TabStop = true; 107 | linkLabelRessourcesOokiDialogsWebsite.Text = "Website"; 108 | linkLabelRessourcesOokiDialogsWebsite.MouseClick += new System.Windows.Forms.MouseEventHandler(this.LinkLabelRessourcesOokiDialogsWebsite_MouseClick); 109 | // 110 | // panel1 111 | // 112 | this.panel1.Controls.Add(this.tableLayoutPanel1); 113 | this.panel1.Location = new System.Drawing.Point(6, 6); 114 | this.panel1.Name = "panel1"; 115 | this.panel1.Size = new System.Drawing.Size(633, 398); 116 | this.panel1.TabIndex = 0; 117 | // 118 | // tableLayoutPanel1 119 | // 120 | this.tableLayoutPanel1.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.Single; 121 | this.tableLayoutPanel1.ColumnCount = 2; 122 | this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 27.63578F)); 123 | this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 72.36422F)); 124 | this.tableLayoutPanel1.Controls.Add(this.label15, 0, 3); 125 | this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0); 126 | this.tableLayoutPanel1.Controls.Add(this.numericNumberOfBackups, 1, 0); 127 | this.tableLayoutPanel1.Controls.Add(this.label2, 0, 1); 128 | this.tableLayoutPanel1.Controls.Add(this.panel2, 1, 1); 129 | this.tableLayoutPanel1.Controls.Add(this.label5, 0, 2); 130 | this.tableLayoutPanel1.Controls.Add(this.panel3, 1, 2); 131 | this.tableLayoutPanel1.Controls.Add(this.panel4, 1, 3); 132 | this.tableLayoutPanel1.GrowStyle = System.Windows.Forms.TableLayoutPanelGrowStyle.FixedSize; 133 | this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 3); 134 | this.tableLayoutPanel1.Name = "tableLayoutPanel1"; 135 | this.tableLayoutPanel1.RowCount = 4; 136 | this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); 137 | this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); 138 | this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 35F)); 139 | this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 65F)); 140 | this.tableLayoutPanel1.Size = new System.Drawing.Size(627, 392); 141 | this.tableLayoutPanel1.TabIndex = 3; 142 | // 143 | // label15 144 | // 145 | this.label15.AutoSize = true; 146 | this.label15.Location = new System.Drawing.Point(4, 336); 147 | this.label15.Margin = new System.Windows.Forms.Padding(3, 10, 3, 0); 148 | this.label15.Name = "label15"; 149 | this.label15.Size = new System.Drawing.Size(95, 13); 150 | this.label15.TabIndex = 8; 151 | this.label15.Text = "Additional settings:"; 152 | // 153 | // label1 154 | // 155 | this.label1.AutoSize = true; 156 | this.label1.Location = new System.Drawing.Point(4, 6); 157 | this.label1.Margin = new System.Windows.Forms.Padding(3, 5, 3, 0); 158 | this.label1.Name = "label1"; 159 | this.label1.Size = new System.Drawing.Size(142, 13); 160 | this.label1.TabIndex = 1; 161 | this.label1.Text = "Number of backups to keep:"; 162 | // 163 | // numericNumberOfBackups 164 | // 165 | this.numericNumberOfBackups.Location = new System.Drawing.Point(177, 4); 166 | this.numericNumberOfBackups.Maximum = new decimal(new int[] { 167 | 10000, 168 | 0, 169 | 0, 170 | 0}); 171 | this.numericNumberOfBackups.Name = "numericNumberOfBackups"; 172 | this.numericNumberOfBackups.Size = new System.Drawing.Size(111, 20); 173 | this.numericNumberOfBackups.TabIndex = 5; 174 | // 175 | // label2 176 | // 177 | this.label2.AutoSize = true; 178 | this.label2.Location = new System.Drawing.Point(4, 43); 179 | this.label2.Margin = new System.Windows.Forms.Padding(3, 15, 3, 0); 180 | this.label2.Name = "label2"; 181 | this.label2.Size = new System.Drawing.Size(114, 13); 182 | this.label2.TabIndex = 3; 183 | this.label2.Text = "Folder for backup files:"; 184 | // 185 | // panel2 186 | // 187 | this.panel2.Controls.Add(this.buttonRemoveSelectedFolder); 188 | this.panel2.Controls.Add(this.listBoxBackupPaths); 189 | this.panel2.Controls.Add(this.buttonAddFolder); 190 | this.panel2.Location = new System.Drawing.Point(177, 31); 191 | this.panel2.Name = "panel2"; 192 | this.panel2.Size = new System.Drawing.Size(446, 255); 193 | this.panel2.TabIndex = 4; 194 | // 195 | // buttonRemoveSelectedFolder 196 | // 197 | this.buttonRemoveSelectedFolder.Enabled = false; 198 | this.buttonRemoveSelectedFolder.Location = new System.Drawing.Point(305, 3); 199 | this.buttonRemoveSelectedFolder.Name = "buttonRemoveSelectedFolder"; 200 | this.buttonRemoveSelectedFolder.Size = new System.Drawing.Size(138, 23); 201 | this.buttonRemoveSelectedFolder.TabIndex = 5; 202 | this.buttonRemoveSelectedFolder.Text = "Remove selected folder"; 203 | this.buttonRemoveSelectedFolder.UseVisualStyleBackColor = true; 204 | this.buttonRemoveSelectedFolder.Click += new System.EventHandler(this.buttonRemoveSelectedFolder_Click); 205 | // 206 | // listBoxBackupPaths 207 | // 208 | this.listBoxBackupPaths.FormattingEnabled = true; 209 | this.listBoxBackupPaths.HorizontalScrollbar = true; 210 | this.listBoxBackupPaths.Location = new System.Drawing.Point(3, 30); 211 | this.listBoxBackupPaths.Name = "listBoxBackupPaths"; 212 | this.listBoxBackupPaths.ScrollAlwaysVisible = true; 213 | this.listBoxBackupPaths.Size = new System.Drawing.Size(440, 225); 214 | this.listBoxBackupPaths.TabIndex = 4; 215 | this.listBoxBackupPaths.SelectedIndexChanged += new System.EventHandler(this.listBoxBackupPaths_SelectedIndexChanged); 216 | // 217 | // buttonAddFolder 218 | // 219 | this.buttonAddFolder.Location = new System.Drawing.Point(3, 3); 220 | this.buttonAddFolder.Name = "buttonAddFolder"; 221 | this.buttonAddFolder.Size = new System.Drawing.Size(75, 23); 222 | this.buttonAddFolder.TabIndex = 2; 223 | this.buttonAddFolder.Text = "Add folder"; 224 | this.buttonAddFolder.UseVisualStyleBackColor = true; 225 | this.buttonAddFolder.Click += new System.EventHandler(this.buttonAddFolder_Click); 226 | // 227 | // label5 228 | // 229 | this.label5.AutoSize = true; 230 | this.label5.Location = new System.Drawing.Point(4, 300); 231 | this.label5.Margin = new System.Windows.Forms.Padding(3, 10, 3, 0); 232 | this.label5.Name = "label5"; 233 | this.label5.Size = new System.Drawing.Size(65, 13); 234 | this.label5.TabIndex = 6; 235 | this.label5.Text = "Date format:"; 236 | // 237 | // panel3 238 | // 239 | this.panel3.Controls.Add(this.buttonDateFormatHelp); 240 | this.panel3.Controls.Add(this.textBoxDateFormat); 241 | this.panel3.Location = new System.Drawing.Point(177, 293); 242 | this.panel3.Name = "panel3"; 243 | this.panel3.Size = new System.Drawing.Size(245, 28); 244 | this.panel3.TabIndex = 7; 245 | // 246 | // buttonDateFormatHelp 247 | // 248 | this.buttonDateFormatHelp.Location = new System.Drawing.Point(219, 4); 249 | this.buttonDateFormatHelp.Name = "buttonDateFormatHelp"; 250 | this.buttonDateFormatHelp.Size = new System.Drawing.Size(20, 20); 251 | this.buttonDateFormatHelp.TabIndex = 1; 252 | this.buttonDateFormatHelp.Text = "?"; 253 | this.buttonDateFormatHelp.UseVisualStyleBackColor = true; 254 | this.buttonDateFormatHelp.Click += new System.EventHandler(this.buttonDateFormatHelp_Click); 255 | // 256 | // textBoxDateFormat 257 | // 258 | this.textBoxDateFormat.Location = new System.Drawing.Point(3, 4); 259 | this.textBoxDateFormat.Name = "textBoxDateFormat"; 260 | this.textBoxDateFormat.Size = new System.Drawing.Size(210, 20); 261 | this.textBoxDateFormat.TabIndex = 0; 262 | this.textBoxDateFormat.TextChanged += new System.EventHandler(this.textBoxDateFormat_TextChanged); 263 | // 264 | // panel4 265 | // 266 | this.panel4.Controls.Add(this.checkBoxBackupKeePassConfig); 267 | this.panel4.Location = new System.Drawing.Point(176, 328); 268 | this.panel4.Margin = new System.Windows.Forms.Padding(2); 269 | this.panel4.Name = "panel4"; 270 | this.panel4.Size = new System.Drawing.Size(448, 60); 271 | this.panel4.TabIndex = 9; 272 | // 273 | // checkBoxBackupKeePassConfig 274 | // 275 | this.checkBoxBackupKeePassConfig.AutoSize = true; 276 | this.checkBoxBackupKeePassConfig.Location = new System.Drawing.Point(4, 2); 277 | this.checkBoxBackupKeePassConfig.Margin = new System.Windows.Forms.Padding(2); 278 | this.checkBoxBackupKeePassConfig.Name = "checkBoxBackupKeePassConfig"; 279 | this.checkBoxBackupKeePassConfig.Size = new System.Drawing.Size(289, 17); 280 | this.checkBoxBackupKeePassConfig.TabIndex = 0; 281 | this.checkBoxBackupKeePassConfig.Text = "Backup KeePass configuration file (KeePass.config.xml)"; 282 | this.checkBoxBackupKeePassConfig.UseVisualStyleBackColor = true; 283 | // 284 | // buttonSave 285 | // 286 | this.buttonSave.Location = new System.Drawing.Point(587, 454); 287 | this.buttonSave.Name = "buttonSave"; 288 | this.buttonSave.Size = new System.Drawing.Size(75, 23); 289 | this.buttonSave.TabIndex = 2; 290 | this.buttonSave.Text = "Save"; 291 | this.buttonSave.UseVisualStyleBackColor = true; 292 | this.buttonSave.Click += new System.EventHandler(this.buttonSave_Click); 293 | // 294 | // checkBoxUseDbName 295 | // 296 | this.checkBoxUseDbName.AutoSize = true; 297 | this.checkBoxUseDbName.Location = new System.Drawing.Point(10, 29); 298 | this.checkBoxUseDbName.Name = "checkBoxUseDbName"; 299 | this.checkBoxUseDbName.Size = new System.Drawing.Size(483, 17); 300 | this.checkBoxUseDbName.TabIndex = 7; 301 | this.checkBoxUseDbName.Text = "Use database name (File -> Database-Settings -> Name) instead of file name as bac" + 302 | "kup file name"; 303 | this.checkBoxUseDbName.UseVisualStyleBackColor = true; 304 | // 305 | // tabControlSettings 306 | // 307 | this.tabControlSettings.Controls.Add(this.tabPage1); 308 | this.tabControlSettings.Controls.Add(this.tabPage2); 309 | this.tabControlSettings.Controls.Add(this.tabPage3); 310 | this.tabControlSettings.Location = new System.Drawing.Point(12, 12); 311 | this.tabControlSettings.Name = "tabControlSettings"; 312 | this.tabControlSettings.SelectedIndex = 0; 313 | this.tabControlSettings.Size = new System.Drawing.Size(650, 436); 314 | this.tabControlSettings.TabIndex = 1; 315 | // 316 | // tabPage1 317 | // 318 | this.tabPage1.Controls.Add(this.panel1); 319 | this.tabPage1.Location = new System.Drawing.Point(4, 22); 320 | this.tabPage1.Name = "tabPage1"; 321 | this.tabPage1.Padding = new System.Windows.Forms.Padding(3); 322 | this.tabPage1.Size = new System.Drawing.Size(642, 410); 323 | this.tabPage1.TabIndex = 0; 324 | this.tabPage1.Text = "General"; 325 | this.tabPage1.UseVisualStyleBackColor = true; 326 | // 327 | // tabPage2 328 | // 329 | this.tabPage2.Controls.Add(this.checkBoxShowBackupFailedWarning); 330 | this.tabPage2.Controls.Add(this.textBoxRelativeBackupPath); 331 | this.tabPage2.Controls.Add(this.buttonRelativeBackupPathHelp); 332 | this.tabPage2.Controls.Add(this.buttonRelativeBackupPathAdd); 333 | this.tabPage2.Controls.Add(this.numericUpDownLtbYearly); 334 | this.tabPage2.Controls.Add(this.numericUpDownLtbMonthly); 335 | this.tabPage2.Controls.Add(this.numericUpDownLtbWeekly); 336 | this.tabPage2.Controls.Add(this.label14); 337 | this.tabPage2.Controls.Add(this.label13); 338 | this.tabPage2.Controls.Add(this.label12); 339 | this.tabPage2.Controls.Add(this.label11); 340 | this.tabPage2.Controls.Add(this.label10); 341 | this.tabPage2.Controls.Add(this.label9); 342 | this.tabPage2.Controls.Add(this.label8); 343 | this.tabPage2.Controls.Add(this.checkBoxEnableLongTermBackups); 344 | this.tabPage2.Controls.Add(this.checkBoxBackupOnDbClose); 345 | this.tabPage2.Controls.Add(this.textBoxBackupFileEnding); 346 | this.tabPage2.Controls.Add(this.checkBoxCustomFileEnding); 347 | this.tabPage2.Controls.Add(this.checkBoxAutoBackup); 348 | this.tabPage2.Controls.Add(this.checkBoxUseRecycleBin); 349 | this.tabPage2.Controls.Add(this.checkBoxUseDbName); 350 | this.tabPage2.Location = new System.Drawing.Point(4, 22); 351 | this.tabPage2.Name = "tabPage2"; 352 | this.tabPage2.Padding = new System.Windows.Forms.Padding(3); 353 | this.tabPage2.Size = new System.Drawing.Size(642, 410); 354 | this.tabPage2.TabIndex = 1; 355 | this.tabPage2.Text = "Advanced"; 356 | this.tabPage2.UseVisualStyleBackColor = true; 357 | // 358 | // checkBoxShowBackupFailedWarning 359 | // 360 | this.checkBoxShowBackupFailedWarning.AutoSize = true; 361 | this.checkBoxShowBackupFailedWarning.Location = new System.Drawing.Point(10, 99); 362 | this.checkBoxShowBackupFailedWarning.Name = "checkBoxShowBackupFailedWarning"; 363 | this.checkBoxShowBackupFailedWarning.Size = new System.Drawing.Size(412, 17); 364 | this.checkBoxShowBackupFailedWarning.TabIndex = 28; 365 | this.checkBoxShowBackupFailedWarning.Text = "Show a popup-warning, if the backup fails or problems occured during the backup"; 366 | this.checkBoxShowBackupFailedWarning.UseVisualStyleBackColor = true; 367 | // 368 | // textBoxRelativeBackupPath 369 | // 370 | this.textBoxRelativeBackupPath.Location = new System.Drawing.Point(10, 202); 371 | this.textBoxRelativeBackupPath.Name = "textBoxRelativeBackupPath"; 372 | this.textBoxRelativeBackupPath.Size = new System.Drawing.Size(218, 20); 373 | this.textBoxRelativeBackupPath.TabIndex = 27; 374 | this.textBoxRelativeBackupPath.TextChanged += new System.EventHandler(this.textBoxRelativeBackupPath_TextChanged); 375 | // 376 | // buttonRelativeBackupPathHelp 377 | // 378 | this.buttonRelativeBackupPathHelp.Location = new System.Drawing.Point(380, 201); 379 | this.buttonRelativeBackupPathHelp.Name = "buttonRelativeBackupPathHelp"; 380 | this.buttonRelativeBackupPathHelp.Size = new System.Drawing.Size(22, 21); 381 | this.buttonRelativeBackupPathHelp.TabIndex = 26; 382 | this.buttonRelativeBackupPathHelp.Text = "?"; 383 | this.buttonRelativeBackupPathHelp.UseVisualStyleBackColor = true; 384 | this.buttonRelativeBackupPathHelp.Click += new System.EventHandler(this.buttonRelativeBackupPathHelp_Click); 385 | // 386 | // buttonRelativeBackupPathAdd 387 | // 388 | this.buttonRelativeBackupPathAdd.Enabled = false; 389 | this.buttonRelativeBackupPathAdd.Location = new System.Drawing.Point(233, 201); 390 | this.buttonRelativeBackupPathAdd.Name = "buttonRelativeBackupPathAdd"; 391 | this.buttonRelativeBackupPathAdd.Size = new System.Drawing.Size(141, 21); 392 | this.buttonRelativeBackupPathAdd.TabIndex = 25; 393 | this.buttonRelativeBackupPathAdd.Text = "Add relative backup path"; 394 | this.buttonRelativeBackupPathAdd.UseVisualStyleBackColor = true; 395 | this.buttonRelativeBackupPathAdd.Click += new System.EventHandler(this.buttonRelativeBackupPathAdd_Click); 396 | // 397 | // numericUpDownLtbYearly 398 | // 399 | this.numericUpDownLtbYearly.Location = new System.Drawing.Point(263, 381); 400 | this.numericUpDownLtbYearly.Maximum = new decimal(new int[] { 401 | 10000, 402 | 0, 403 | 0, 404 | 0}); 405 | this.numericUpDownLtbYearly.Minimum = new decimal(new int[] { 406 | 1, 407 | 0, 408 | 0, 409 | 0}); 410 | this.numericUpDownLtbYearly.Name = "numericUpDownLtbYearly"; 411 | this.numericUpDownLtbYearly.Size = new System.Drawing.Size(111, 20); 412 | this.numericUpDownLtbYearly.TabIndex = 24; 413 | this.numericUpDownLtbYearly.Value = new decimal(new int[] { 414 | 1, 415 | 0, 416 | 0, 417 | 0}); 418 | // 419 | // numericUpDownLtbMonthly 420 | // 421 | this.numericUpDownLtbMonthly.Location = new System.Drawing.Point(263, 355); 422 | this.numericUpDownLtbMonthly.Maximum = new decimal(new int[] { 423 | 10000, 424 | 0, 425 | 0, 426 | 0}); 427 | this.numericUpDownLtbMonthly.Minimum = new decimal(new int[] { 428 | 1, 429 | 0, 430 | 0, 431 | 0}); 432 | this.numericUpDownLtbMonthly.Name = "numericUpDownLtbMonthly"; 433 | this.numericUpDownLtbMonthly.Size = new System.Drawing.Size(111, 20); 434 | this.numericUpDownLtbMonthly.TabIndex = 23; 435 | this.numericUpDownLtbMonthly.Value = new decimal(new int[] { 436 | 1, 437 | 0, 438 | 0, 439 | 0}); 440 | // 441 | // numericUpDownLtbWeekly 442 | // 443 | this.numericUpDownLtbWeekly.Location = new System.Drawing.Point(263, 329); 444 | this.numericUpDownLtbWeekly.Maximum = new decimal(new int[] { 445 | 10000, 446 | 0, 447 | 0, 448 | 0}); 449 | this.numericUpDownLtbWeekly.Minimum = new decimal(new int[] { 450 | 1, 451 | 0, 452 | 0, 453 | 0}); 454 | this.numericUpDownLtbWeekly.Name = "numericUpDownLtbWeekly"; 455 | this.numericUpDownLtbWeekly.Size = new System.Drawing.Size(111, 20); 456 | this.numericUpDownLtbWeekly.TabIndex = 22; 457 | this.numericUpDownLtbWeekly.Value = new decimal(new int[] { 458 | 1, 459 | 0, 460 | 0, 461 | 0}); 462 | // 463 | // label14 464 | // 465 | this.label14.AutoSize = true; 466 | this.label14.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 467 | this.label14.Location = new System.Drawing.Point(30, 383); 468 | this.label14.Name = "label14"; 469 | this.label14.Size = new System.Drawing.Size(205, 13); 470 | this.label14.TabIndex = 21; 471 | this.label14.Text = "Amount of yearly backups to keep (years):"; 472 | // 473 | // label13 474 | // 475 | this.label13.AutoSize = true; 476 | this.label13.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 477 | this.label13.Location = new System.Drawing.Point(30, 357); 478 | this.label13.Name = "label13"; 479 | this.label13.Size = new System.Drawing.Size(223, 13); 480 | this.label13.TabIndex = 20; 481 | this.label13.Text = "Amount of monthly backups to keep (months):"; 482 | // 483 | // label12 484 | // 485 | this.label12.AutoSize = true; 486 | this.label12.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 487 | this.label12.Location = new System.Drawing.Point(30, 331); 488 | this.label12.Name = "label12"; 489 | this.label12.Size = new System.Drawing.Size(217, 13); 490 | this.label12.TabIndex = 19; 491 | this.label12.Text = "Amount of weekly backups to keep (weeks):"; 492 | // 493 | // label11 494 | // 495 | this.label11.AutoSize = true; 496 | this.label11.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 497 | this.label11.Location = new System.Drawing.Point(8, 259); 498 | this.label11.Name = "label11"; 499 | this.label11.Size = new System.Drawing.Size(612, 39); 500 | this.label11.TabIndex = 18; 501 | this.label11.Text = resources.GetString("label11.Text"); 502 | // 503 | // label10 504 | // 505 | this.label10.AutoSize = true; 506 | this.label10.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 507 | this.label10.Location = new System.Drawing.Point(6, 235); 508 | this.label10.Name = "label10"; 509 | this.label10.Size = new System.Drawing.Size(170, 20); 510 | this.label10.TabIndex = 17; 511 | this.label10.Text = "Long-Term-Backups"; 512 | // 513 | // label9 514 | // 515 | this.label9.AutoSize = true; 516 | this.label9.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 517 | this.label9.Location = new System.Drawing.Point(6, 131); 518 | this.label9.Name = "label9"; 519 | this.label9.Size = new System.Drawing.Size(221, 20); 520 | this.label9.TabIndex = 16; 521 | this.label9.Text = "Advanced Backup-Options"; 522 | // 523 | // label8 524 | // 525 | this.label8.AutoSize = true; 526 | this.label8.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 527 | this.label8.Location = new System.Drawing.Point(6, 6); 528 | this.label8.Name = "label8"; 529 | this.label8.Size = new System.Drawing.Size(206, 20); 530 | this.label8.TabIndex = 15; 531 | this.label8.Text = "General Backup-Options"; 532 | // 533 | // checkBoxEnableLongTermBackups 534 | // 535 | this.checkBoxEnableLongTermBackups.AutoSize = true; 536 | this.checkBoxEnableLongTermBackups.Location = new System.Drawing.Point(12, 306); 537 | this.checkBoxEnableLongTermBackups.Name = "checkBoxEnableLongTermBackups"; 538 | this.checkBoxEnableLongTermBackups.Size = new System.Drawing.Size(158, 17); 539 | this.checkBoxEnableLongTermBackups.TabIndex = 14; 540 | this.checkBoxEnableLongTermBackups.Text = "Enable Long-Term-Backups"; 541 | this.checkBoxEnableLongTermBackups.UseVisualStyleBackColor = true; 542 | this.checkBoxEnableLongTermBackups.CheckedChanged += new System.EventHandler(this.CheckBoxEnableLongTermBackups_CheckedChanged); 543 | // 544 | // checkBoxBackupOnDbClose 545 | // 546 | this.checkBoxBackupOnDbClose.AutoSize = true; 547 | this.checkBoxBackupOnDbClose.Location = new System.Drawing.Point(10, 177); 548 | this.checkBoxBackupOnDbClose.Name = "checkBoxBackupOnDbClose"; 549 | this.checkBoxBackupOnDbClose.Size = new System.Drawing.Size(612, 17); 550 | this.checkBoxBackupOnDbClose.TabIndex = 13; 551 | this.checkBoxBackupOnDbClose.Text = "Backup Database on Close (new backup is created whenever the database is closed/l" + 552 | "ocked; also when KeePass is closed)"; 553 | this.checkBoxBackupOnDbClose.UseVisualStyleBackColor = true; 554 | // 555 | // textBoxBackupFileEnding 556 | // 557 | this.textBoxBackupFileEnding.Location = new System.Drawing.Point(317, 154); 558 | this.textBoxBackupFileEnding.Name = "textBoxBackupFileEnding"; 559 | this.textBoxBackupFileEnding.Size = new System.Drawing.Size(145, 20); 560 | this.textBoxBackupFileEnding.TabIndex = 12; 561 | // 562 | // checkBoxCustomFileEnding 563 | // 564 | this.checkBoxCustomFileEnding.AutoSize = true; 565 | this.checkBoxCustomFileEnding.Location = new System.Drawing.Point(10, 154); 566 | this.checkBoxCustomFileEnding.Name = "checkBoxCustomFileEnding"; 567 | this.checkBoxCustomFileEnding.Size = new System.Drawing.Size(274, 17); 568 | this.checkBoxCustomFileEnding.TabIndex = 11; 569 | this.checkBoxCustomFileEnding.Text = "Use custom File-Ending (Extension) for Backup-Files:"; 570 | this.checkBoxCustomFileEnding.UseVisualStyleBackColor = true; 571 | this.checkBoxCustomFileEnding.CheckedChanged += new System.EventHandler(this.CheckBoxCustomFileEnding_CheckedChanged); 572 | // 573 | // checkBoxAutoBackup 574 | // 575 | this.checkBoxAutoBackup.AutoSize = true; 576 | this.checkBoxAutoBackup.Location = new System.Drawing.Point(10, 76); 577 | this.checkBoxAutoBackup.Name = "checkBoxAutoBackup"; 578 | this.checkBoxAutoBackup.Size = new System.Drawing.Size(461, 17); 579 | this.checkBoxAutoBackup.TabIndex = 10; 580 | this.checkBoxAutoBackup.Text = "Backup Database on Save (new backup is created, whenever the database is being sa" + 581 | "ved)"; 582 | this.checkBoxAutoBackup.UseVisualStyleBackColor = true; 583 | // 584 | // checkBoxUseRecycleBin 585 | // 586 | this.checkBoxUseRecycleBin.AutoSize = true; 587 | this.checkBoxUseRecycleBin.Location = new System.Drawing.Point(10, 53); 588 | this.checkBoxUseRecycleBin.Name = "checkBoxUseRecycleBin"; 589 | this.checkBoxUseRecycleBin.Size = new System.Drawing.Size(586, 17); 590 | this.checkBoxUseRecycleBin.TabIndex = 8; 591 | this.checkBoxUseRecycleBin.Text = "Use Recycle Bin (enabling this option moves cleaned up backup files to the trash " + 592 | "instead of permanently deleting them)"; 593 | this.checkBoxUseRecycleBin.UseVisualStyleBackColor = true; 594 | // 595 | // tabPage3 596 | // 597 | this.tabPage3.Controls.Add(linkLabelRessourcesOokiDialogsWebsite); 598 | this.tabPage3.Controls.Add(this.linkLabelRessourcesOokiDialogsGitHub); 599 | this.tabPage3.Controls.Add(this.label7); 600 | this.tabPage3.Controls.Add(this.label6); 601 | this.tabPage3.Controls.Add(this.linkLabelReportBug); 602 | this.tabPage3.Controls.Add(this.labelVersion); 603 | this.tabPage3.Controls.Add(this.label4); 604 | this.tabPage3.Location = new System.Drawing.Point(4, 22); 605 | this.tabPage3.Name = "tabPage3"; 606 | this.tabPage3.Size = new System.Drawing.Size(642, 410); 607 | this.tabPage3.TabIndex = 2; 608 | this.tabPage3.Text = "About"; 609 | this.tabPage3.UseVisualStyleBackColor = true; 610 | // 611 | // linkLabelRessourcesOokiDialogsGitHub 612 | // 613 | this.linkLabelRessourcesOokiDialogsGitHub.ActiveLinkColor = System.Drawing.Color.DarkRed; 614 | this.linkLabelRessourcesOokiDialogsGitHub.AutoSize = true; 615 | this.linkLabelRessourcesOokiDialogsGitHub.LinkColor = System.Drawing.Color.DarkRed; 616 | this.linkLabelRessourcesOokiDialogsGitHub.Location = new System.Drawing.Point(8, 166); 617 | this.linkLabelRessourcesOokiDialogsGitHub.Name = "linkLabelRessourcesOokiDialogsGitHub"; 618 | this.linkLabelRessourcesOokiDialogsGitHub.Size = new System.Drawing.Size(40, 13); 619 | this.linkLabelRessourcesOokiDialogsGitHub.TabIndex = 5; 620 | this.linkLabelRessourcesOokiDialogsGitHub.TabStop = true; 621 | this.linkLabelRessourcesOokiDialogsGitHub.Text = "GitHub"; 622 | this.linkLabelRessourcesOokiDialogsGitHub.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkLabelRessourcesOokiDialogsGitHub_LinkClicked); 623 | // 624 | // label7 625 | // 626 | this.label7.AutoSize = true; 627 | this.label7.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 628 | this.label7.Location = new System.Drawing.Point(7, 149); 629 | this.label7.Margin = new System.Windows.Forms.Padding(3, 10, 3, 0); 630 | this.label7.Name = "label7"; 631 | this.label7.Size = new System.Drawing.Size(435, 17); 632 | this.label7.TabIndex = 4; 633 | this.label7.Text = "Ookii.Dialogs.WinForms - Copyright (c) Sven Groot (Ookii.org) 2009"; 634 | // 635 | // label6 636 | // 637 | this.label6.AutoSize = true; 638 | this.label6.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 639 | this.label6.Location = new System.Drawing.Point(6, 119); 640 | this.label6.Margin = new System.Windows.Forms.Padding(3, 10, 3, 0); 641 | this.label6.Name = "label6"; 642 | this.label6.Size = new System.Drawing.Size(389, 20); 643 | this.label6.TabIndex = 3; 644 | this.label6.Text = "Open source software used in KPSimpleBackup"; 645 | // 646 | // linkLabelReportBug 647 | // 648 | this.linkLabelReportBug.ActiveLinkColor = System.Drawing.Color.DarkRed; 649 | this.linkLabelReportBug.AutoSize = true; 650 | this.linkLabelReportBug.LinkColor = System.Drawing.Color.DarkRed; 651 | this.linkLabelReportBug.Location = new System.Drawing.Point(8, 64); 652 | this.linkLabelReportBug.Name = "linkLabelReportBug"; 653 | this.linkLabelReportBug.Size = new System.Drawing.Size(61, 13); 654 | this.linkLabelReportBug.TabIndex = 2; 655 | this.linkLabelReportBug.TabStop = true; 656 | this.linkLabelReportBug.Text = "Report Bug"; 657 | this.linkLabelReportBug.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabelReportBug_LinkClicked); 658 | // 659 | // labelVersion 660 | // 661 | this.labelVersion.AutoSize = true; 662 | this.labelVersion.Location = new System.Drawing.Point(8, 39); 663 | this.labelVersion.Name = "labelVersion"; 664 | this.labelVersion.Size = new System.Drawing.Size(42, 13); 665 | this.labelVersion.TabIndex = 1; 666 | this.labelVersion.Text = "Version"; 667 | // 668 | // label4 669 | // 670 | this.label4.AutoSize = true; 671 | this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 672 | this.label4.Location = new System.Drawing.Point(3, 10); 673 | this.label4.Margin = new System.Windows.Forms.Padding(3, 10, 3, 0); 674 | this.label4.Name = "label4"; 675 | this.label4.Size = new System.Drawing.Size(191, 25); 676 | this.label4.TabIndex = 0; 677 | this.label4.Text = "KPSimpleBackup"; 678 | // 679 | // SettingsForm 680 | // 681 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 682 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 683 | this.ClientSize = new System.Drawing.Size(674, 489); 684 | this.Controls.Add(this.tabControlSettings); 685 | this.Controls.Add(this.buttonSave); 686 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; 687 | this.MaximizeBox = false; 688 | this.MinimizeBox = false; 689 | this.Name = "SettingsForm"; 690 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; 691 | this.Text = "Settings"; 692 | this.panel1.ResumeLayout(false); 693 | this.tableLayoutPanel1.ResumeLayout(false); 694 | this.tableLayoutPanel1.PerformLayout(); 695 | ((System.ComponentModel.ISupportInitialize)(this.numericNumberOfBackups)).EndInit(); 696 | this.panel2.ResumeLayout(false); 697 | this.panel3.ResumeLayout(false); 698 | this.panel3.PerformLayout(); 699 | this.panel4.ResumeLayout(false); 700 | this.panel4.PerformLayout(); 701 | this.tabControlSettings.ResumeLayout(false); 702 | this.tabPage1.ResumeLayout(false); 703 | this.tabPage2.ResumeLayout(false); 704 | this.tabPage2.PerformLayout(); 705 | ((System.ComponentModel.ISupportInitialize)(this.numericUpDownLtbYearly)).EndInit(); 706 | ((System.ComponentModel.ISupportInitialize)(this.numericUpDownLtbMonthly)).EndInit(); 707 | ((System.ComponentModel.ISupportInitialize)(this.numericUpDownLtbWeekly)).EndInit(); 708 | this.tabPage3.ResumeLayout(false); 709 | this.tabPage3.PerformLayout(); 710 | this.ResumeLayout(false); 711 | 712 | } 713 | 714 | #endregion 715 | private System.Windows.Forms.Panel panel1; 716 | private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; 717 | private System.Windows.Forms.Button buttonSave; 718 | private System.Windows.Forms.Label label1; 719 | private System.Windows.Forms.Button buttonAddFolder; 720 | private System.Windows.Forms.Label label2; 721 | private System.Windows.Forms.Panel panel2; 722 | private System.Windows.Forms.NumericUpDown numericNumberOfBackups; 723 | private System.Windows.Forms.CheckBox checkBoxUseDbName; 724 | private System.Windows.Forms.TabControl tabControlSettings; 725 | private System.Windows.Forms.TabPage tabPage1; 726 | private System.Windows.Forms.TabPage tabPage2; 727 | private System.Windows.Forms.CheckBox checkBoxUseRecycleBin; 728 | private System.Windows.Forms.CheckBox checkBoxAutoBackup; 729 | private System.Windows.Forms.ListBox listBoxBackupPaths; 730 | private System.Windows.Forms.Button buttonRemoveSelectedFolder; 731 | private System.Windows.Forms.TabPage tabPage3; 732 | private System.Windows.Forms.Label label5; 733 | private System.Windows.Forms.Label labelVersion; 734 | private System.Windows.Forms.Label label4; 735 | private System.Windows.Forms.Panel panel3; 736 | private System.Windows.Forms.Button buttonDateFormatHelp; 737 | private System.Windows.Forms.TextBox textBoxDateFormat; 738 | private System.Windows.Forms.LinkLabel linkLabelReportBug; 739 | private System.Windows.Forms.LinkLabel linkLabelRessourcesOokiDialogsGitHub; 740 | private System.Windows.Forms.Label label7; 741 | private System.Windows.Forms.Label label6; 742 | private System.Windows.Forms.TextBox textBoxBackupFileEnding; 743 | private System.Windows.Forms.CheckBox checkBoxCustomFileEnding; 744 | private System.Windows.Forms.CheckBox checkBoxBackupOnDbClose; 745 | private System.Windows.Forms.CheckBox checkBoxEnableLongTermBackups; 746 | private System.Windows.Forms.Label label11; 747 | private System.Windows.Forms.Label label10; 748 | private System.Windows.Forms.Label label9; 749 | private System.Windows.Forms.Label label8; 750 | private System.Windows.Forms.NumericUpDown numericUpDownLtbYearly; 751 | private System.Windows.Forms.NumericUpDown numericUpDownLtbMonthly; 752 | private System.Windows.Forms.NumericUpDown numericUpDownLtbWeekly; 753 | private System.Windows.Forms.Label label14; 754 | private System.Windows.Forms.Label label13; 755 | private System.Windows.Forms.Label label12; 756 | private System.Windows.Forms.Label label15; 757 | private System.Windows.Forms.Panel panel4; 758 | private System.Windows.Forms.CheckBox checkBoxBackupKeePassConfig; 759 | private System.Windows.Forms.TextBox textBoxRelativeBackupPath; 760 | private System.Windows.Forms.Button buttonRelativeBackupPathHelp; 761 | private System.Windows.Forms.Button buttonRelativeBackupPathAdd; 762 | private System.Windows.Forms.CheckBox checkBoxShowBackupFailedWarning; 763 | } 764 | } -------------------------------------------------------------------------------- /KPSimpleBackup/SettingsForm.cs: -------------------------------------------------------------------------------- 1 | using Ookii.Dialogs.WinForms; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text.RegularExpressions; 5 | using System.Windows.Forms; 6 | 7 | namespace KPSimpleBackup 8 | { 9 | public partial class SettingsForm : Form 10 | { 11 | private KPSimpleBackupConfig appConfig; 12 | private static readonly String DATE_FORMAT_REGEX = "[^A-Za-z0-9:._+-;]"; 13 | 14 | public SettingsForm(KPSimpleBackupConfig config) 15 | { 16 | this.appConfig = config; 17 | 18 | InitializeComponent(); 19 | 20 | // load (already) configured values 21 | this.LoadValues(); 22 | } 23 | 24 | private void buttonAddFolder_Click(object sender, EventArgs e) 25 | { 26 | VistaFolderBrowserDialog dialog = new VistaFolderBrowserDialog(); 27 | dialog.Description = "Select a backup folder"; 28 | dialog.UseDescriptionForTitle = true; 29 | DialogResult result = dialog.ShowDialog(); 30 | if (result == DialogResult.OK) 31 | { 32 | string pathSelected = dialog.SelectedPath; 33 | 34 | // replace backslash (windows-specific) with slash 35 | pathSelected = pathSelected.Replace("\\", "/"); 36 | 37 | string newPath = pathSelected + "/"; 38 | 39 | // add new path to the list box 40 | listBoxBackupPaths.Items.Add(newPath); 41 | } 42 | } 43 | 44 | private void buttonRemoveSelectedFolder_Click(object sender, EventArgs e) 45 | { 46 | // return if no item is selected 47 | if (listBoxBackupPaths.SelectedIndex == -1) 48 | { 49 | return; 50 | } 51 | 52 | // remove item from listBox 53 | listBoxBackupPaths.Items.RemoveAt(listBoxBackupPaths.SelectedIndex); 54 | } 55 | 56 | /// 57 | /// Store the current state of the settings form to 58 | /// the plugins configuration. 59 | /// 60 | /// 61 | /// 62 | private void buttonSave_Click(object sender, EventArgs e) 63 | { 64 | // save values and close settings form 65 | this.appConfig.FileAmountToKeep = (long) numericNumberOfBackups.Value; 66 | this.appConfig.UseDatabaseNameForBackupFiles = checkBoxUseDbName.Checked; 67 | this.appConfig.UseRecycleBinDeletedBackups = checkBoxUseRecycleBin.Checked; 68 | this.appConfig.ShowBackupFailedWarning = checkBoxShowBackupFailedWarning.Checked; 69 | 70 | // auto backup and backup on database close 71 | this.appConfig.AutoDatabaseBackup = checkBoxAutoBackup.Checked; 72 | this.appConfig.BackupOnDbClose = checkBoxBackupOnDbClose.Checked; 73 | 74 | // custom file extension 75 | this.appConfig.UseCustomBackupFileExtension = checkBoxCustomFileEnding.Checked; 76 | string backupFileExtension = textBoxBackupFileEnding.Text; 77 | // add prepending point at beginning of file-extension if not set by user 78 | if (backupFileExtension.ToCharArray()[0] != '.') 79 | { 80 | backupFileExtension = "." + backupFileExtension; 81 | } 82 | this.appConfig.BackupFileExtension = backupFileExtension; 83 | 84 | // long term backups 85 | this.appConfig.UseLongTermBackup = checkBoxEnableLongTermBackups.Checked; 86 | this.appConfig.LtbWeeklyAmount = (int) numericUpDownLtbWeekly.Value; 87 | this.appConfig.LtbMonthlyAmount = (int) numericUpDownLtbMonthly.Value; 88 | this.appConfig.LtbYearlyAmount = (int) numericUpDownLtbYearly.Value; 89 | 90 | // date format 91 | this.appConfig.DateFormat = textBoxDateFormat.Text; 92 | 93 | // KeePass config backup 94 | this.appConfig.BackupKeePassConfig = checkBoxBackupKeePassConfig.Checked; 95 | 96 | // save paths 97 | List paths = new List(); 98 | foreach (object item in listBoxBackupPaths.Items) 99 | { 100 | paths.Add((string)item); 101 | } 102 | this.appConfig.BackupPath = paths; 103 | 104 | this.Close(); 105 | } 106 | 107 | /// 108 | /// Load the current plugins' configuration into the 109 | /// settings form. 110 | /// 111 | private void LoadValues() 112 | { 113 | checkBoxUseDbName.Checked = this.appConfig.UseDatabaseNameForBackupFiles; 114 | numericNumberOfBackups.Value = this.appConfig.FileAmountToKeep; 115 | checkBoxUseRecycleBin.Checked = this.appConfig.UseRecycleBinDeletedBackups; 116 | checkBoxShowBackupFailedWarning.Checked = this.appConfig.ShowBackupFailedWarning; 117 | 118 | // auto backup and backup on database close 119 | checkBoxAutoBackup.Checked = this.appConfig.AutoDatabaseBackup; 120 | checkBoxBackupOnDbClose.Checked = this.appConfig.BackupOnDbClose; 121 | 122 | // custom file extension checkbox & text box 123 | checkBoxCustomFileEnding.Checked = this.appConfig.UseCustomBackupFileExtension; 124 | textBoxBackupFileEnding.Text = this.appConfig.BackupFileExtension; 125 | textBoxBackupFileEnding.Enabled = this.appConfig.UseCustomBackupFileExtension; 126 | 127 | // long term backups 128 | checkBoxEnableLongTermBackups.Checked = this.appConfig.UseLongTermBackup; 129 | this.SetLtbDurationNumericSettingsEnabledStatus(this.appConfig.UseLongTermBackup); 130 | numericUpDownLtbWeekly.Value = this.appConfig.LtbWeeklyAmount; 131 | numericUpDownLtbMonthly.Value = this.appConfig.LtbMonthlyAmount; 132 | numericUpDownLtbYearly.Value = this.appConfig.LtbYearlyAmount; 133 | 134 | // KeePass config backup 135 | checkBoxBackupKeePassConfig.Checked = this.appConfig.BackupKeePassConfig; 136 | 137 | // date format 138 | textBoxDateFormat.Text = this.appConfig.DateFormat; 139 | 140 | // version label 141 | labelVersion.Text = "Version " + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(); 142 | this.LoadBackupPaths(); 143 | } 144 | 145 | private void LoadBackupPaths() 146 | { 147 | // remove all items to prevent duplicate entries in the box 148 | listBoxBackupPaths.Items.Clear(); 149 | 150 | List paths = this.appConfig.BackupPath; 151 | 152 | foreach(String path in paths) 153 | { 154 | // skip empty paths 155 | if (path != "") 156 | { 157 | listBoxBackupPaths.Items.Add(path); 158 | } 159 | } 160 | } 161 | 162 | private void listBoxBackupPaths_SelectedIndexChanged(object sender, EventArgs e) 163 | { 164 | // enable / disable remove button depending on whether a item is selected or not 165 | buttonRemoveSelectedFolder.Enabled = listBoxBackupPaths.SelectedIndex != -1; 166 | } 167 | 168 | private void buttonDateFormatHelp_Click(object sender, EventArgs e) 169 | { 170 | System.Diagnostics.Process.Start("https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings"); 171 | } 172 | 173 | private void textBoxDateFormat_TextChanged(object sender, EventArgs e) 174 | { 175 | // validate date format input (remove invalid characters) 176 | textBoxDateFormat.Text = Regex.Replace(textBoxDateFormat.Text, DATE_FORMAT_REGEX, ""); 177 | } 178 | 179 | private void linkLabelReportBug_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) 180 | { 181 | System.Diagnostics.Process.Start("https://github.com/marvinweber/KPSimpleBackup/issues"); 182 | } 183 | 184 | private void LinkLabelRessourcesOokiDialogsWebsite_MouseClick(object sender, MouseEventArgs e) 185 | { 186 | System.Diagnostics.Process.Start("http://www.ookii.org/Software/Dialogs/"); 187 | } 188 | 189 | private void LinkLabelRessourcesOokiDialogsGitHub_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) 190 | { 191 | System.Diagnostics.Process.Start("https://github.com/caioproiete/ookii-dialogs-winforms"); 192 | } 193 | 194 | private void CheckBoxCustomFileEnding_CheckedChanged(object sender, EventArgs e) 195 | { 196 | System.Windows.Forms.CheckBox checkbox = sender as System.Windows.Forms.CheckBox; 197 | if (checkbox != null) 198 | { 199 | textBoxBackupFileEnding.Enabled = checkbox.Checked; 200 | } 201 | } 202 | 203 | private void CheckBoxEnableLongTermBackups_CheckedChanged(object sender, EventArgs e) 204 | { 205 | System.Windows.Forms.CheckBox checkbox = sender as System.Windows.Forms.CheckBox; 206 | if (checkbox != null) 207 | { 208 | this.SetLtbDurationNumericSettingsEnabledStatus(checkbox.Checked); 209 | } 210 | } 211 | 212 | /// 213 | /// Set the enabled status of the numericUpDowns for the Ltb 214 | /// settings (how long each type should be kept). 215 | /// 216 | /// if numericUpDown should be enabled 217 | /// or not 218 | private void SetLtbDurationNumericSettingsEnabledStatus(bool enabled) 219 | { 220 | numericUpDownLtbWeekly.Enabled = enabled; 221 | numericUpDownLtbMonthly.Enabled = enabled; 222 | numericUpDownLtbYearly.Enabled = enabled; 223 | } 224 | 225 | private void buttonRelativeBackupPathHelp_Click(object sender, EventArgs e) 226 | { 227 | System.Diagnostics.Process.Start("https://github.com/marvinweber/KPSimpleBackup/wiki/User-Documentation#relative-backup-path"); 228 | } 229 | 230 | /// 231 | /// Handler for changes of the textbox to add relative backup 232 | /// paths. The button to add a relative path will be disabled/ 233 | /// enabled depending on whether the textbox is empty or not. 234 | /// 235 | /// 236 | /// 237 | private void textBoxRelativeBackupPath_TextChanged(object sender, EventArgs e) 238 | { 239 | TextBox textBox = sender as TextBox; 240 | buttonRelativeBackupPathAdd.Enabled = textBox != null && textBox.TextLength > 0; 241 | } 242 | 243 | /// 244 | /// Handler for the button to add a new relative backup path. 245 | /// Add the relative path to the selected paths and clear the 246 | /// input textbox. 247 | /// 248 | /// 249 | /// 250 | private void buttonRelativeBackupPathAdd_Click(object sender, EventArgs e) 251 | { 252 | string path = textBoxRelativeBackupPath.Text; 253 | listBoxBackupPaths.Items.Add(path); 254 | textBoxRelativeBackupPath.Clear(); 255 | } 256 | } 257 | } 258 | -------------------------------------------------------------------------------- /KPSimpleBackup/SettingsForm.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | False 122 | 123 | 124 | Long-Term-Backups (LTB-Backups) can be used to keep a longer history of backup files. If enabled, weekly, monthly, and yearly 125 | backups will be kept (separatly to the standard backup files). Only one backup-file per week/month/year will be kept. 126 | LTB-Backups are stored in a subfolder in all your backup locations. 127 | 128 | -------------------------------------------------------------------------------- /KPSimpleBackup/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /KPSimpleBackup/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # KPSimpleBackup 2 | This is a simple KeePass Plugin that saves a backup of your Password-Database to a backup location and keeps a specific amount of the most recent backups - every time you save your database or trigger the backup manually. 3 | 4 | --- 5 | 6 | **Note: I don't accept responsibility for any data loss!** 7 | (However, the originial Database File should not be touched by this plugin. To prevent data loss don't disable the usage of the recycle bin!) 8 | 9 | ## Wiki 10 | More information about installation, setup, etc. in the [KPSimpleBackup Wiki](https://github.com/marvinweber/KPSimpleBackup/wiki). 11 | 12 | ## Installation & Documentation 13 | * [Installation instructions](https://github.com/marvinweber/KPSimpleBackup/wiki/Installation) 14 | * [Usage/ Settings instructions / Documentation](https://github.com/marvinweber/KPSimpleBackup/wiki/User-Documentation). 15 | 16 | ## Credits 17 | Credits to [caioproiete/ookii-dialogs-winforms](https://github.com/caioproiete/ookii-dialogs-winforms) which is used for the backup-folder selection dialog in KPSimple Backup. 18 | -------------------------------------------------------------------------------- /kpsimplebackup.version: -------------------------------------------------------------------------------- 1 | : 2 | KPSimpleBackup:1.4.0 3 | : 4 | -------------------------------------------------------------------------------- /resources/screenshots/settings_advanced.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marvinweber/KPSimpleBackup/b62984e8dee476e03046718afb6942a9e933a1fd/resources/screenshots/settings_advanced.png -------------------------------------------------------------------------------- /resources/screenshots/settings_general.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marvinweber/KPSimpleBackup/b62984e8dee476e03046718afb6942a9e933a1fd/resources/screenshots/settings_general.png --------------------------------------------------------------------------------