add check to avoid distributed backup path to be in the same location of databases
@@ -1901,6 +1901,12 @@ public class ODistributedPlugin extends OServerPluginAbstract
final File oldDirectory = new File(dbpath);
if (oldDirectory.exists() && oldDirectory.isDirectory()) {
+ if (oldDirectory.getCanonicalPath().equals(backupFullPath.getCanonicalPath())) {
+ throw new ODistributedException(
+ String.format(
+ "Backup folder configured as same of database folder:'%s'",
+ oldDirectory.getAbsolutePath()));
+ }
try {
Files.move(
oldDirectory.toPath(), backupFullPath.toPath(), StandardCopyOption.ATOMIC_MOVE);
