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
This commit is contained in:
kohsuke committed 2009-02-12 21:52:31 +00:00
1 parent 942120a734
commit 45d486f2b3
1 file changed
+2
@@ -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");
}