So, looking at the code:

    public void maybeRestoreArchive()
    {
        if (Strings.isNullOrEmpty(restoreDirectories))
            return;

        for (String dir : restoreDirectories.split(","))
        {
            File[] files = new File(dir).listFiles();
            if (files == null)
            {
throw new RuntimeException("Unable to list director " + dir);
            }
            for (File fromFile : files)
            {
File toFile = new File(DatabaseDescriptor.getCommitLogLocation(), new CommitLogDescriptor(CommitLogSegment.getNextId()).fileName()); String command = restoreCommand.replace("%from", fromFile.getPath());
                command = command.replace("%to", toFile.getPath());
                try
                {
                    exec(command);
                }
                catch (IOException e)
                {
                    throw new RuntimeException(e);
                }
            }
        }
    }


I would like someone to confirm that, but it might potentially be a bug. It does the right thing for an empty restore directory. However it ignores the fact that the restore command could be empty. So for you, jonathan, I reckon you have the restore directory set? You don't need that to be set in order to archive (only if you want to restore it). So set your restore_directory property to empty and you should get rid of those errors. The directory needs to be set when you enable the restore command.

On a second look, I am almost certain this is a bug, as the maybeArchive command does correctly check for the command to not be empty or null. The maybeRestore command needs to do the same thing for the restoreCommand. If someone confirms, I am happy to raise a bug.

cheers,

artur

On 11/12/13 14:09, Bonnet Jonathan. wrote:
Artur Kronenberg <artur.kronenberg <at> openmarket.com> writes:


     hi Bonnet,
       that doesn't seem to be a problem with your archiving, rather with
       the restoring. What is your restore command?
       -- artur
       On 11/12/13 13:47, Bonnet Jonathan. wrote:

Thanks to answear so fast,

I put nothing for restore ? should I ? cause i don't want to restore for the
moment.

Regards,






Reply via email to