Only backup database and config file before update

This commit is contained in:
Mark McDowall
2014-02-07 18:16:19 -08:00
parent 85b211738b
commit e16a6f2b9c
4 changed files with 27 additions and 9 deletions
@@ -204,6 +204,20 @@ namespace NzbDrone.Common.Disk
File.Delete(path);
}
public void CopyFile(string source, string destination, bool overwrite = false)
{
Ensure.That(source, () => source).IsValidPath();
Ensure.That(destination, () => destination).IsValidPath();
if (source.PathEquals(destination))
{
Logger.Warn("Source and destination can't be the same {0}", source);
return;
}
File.Copy(source, destination, overwrite);
}
public void MoveFile(string source, string destination)
{
Ensure.That(source, () => source).IsValidPath();