From 45d486f2b35b1accb30ab9f8e7a573de91fe6dc6 Mon Sep 17 00:00:00 2001 From: kohsuke Date: Thu, 12 Feb 2009 21:52:31 +0000 Subject: [PATCH] if back up already exists, delete it git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@15267 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/main/java/hudson/lifecycle/ZFSInstaller.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/src/main/java/hudson/lifecycle/ZFSInstaller.java b/core/src/main/java/hudson/lifecycle/ZFSInstaller.java index e253cb6215..8583b4511f 100644 --- a/core/src/main/java/hudson/lifecycle/ZFSInstaller.java +++ b/core/src/main/java/hudson/lifecycle/ZFSInstaller.java @@ -384,6 +384,8 @@ public class ZFSInstaller extends AdministrativeMonitor implements Serializable // move the original directory to the side File backup = new File(home.getPath()+".backup"); out.println("Moving "+home+" to "+backup); + if(backup.exists()) + Util.deleteRecursive(backup); if(!home.renameTo(backup)) { out.println("Failed to move your current data "+home+" out of the way"); }