I have a problem with backing up raw contents of LVM volume.

Since Bareos can backup a device contents only when referenced a device file, not a Device Mapper symlink, the definition of FileSet as:

    File = "\\| readlink -f /dev/virt_srv1/vm1"

Seemed to go relatively well - the job was spawned, the DM link was being canonicalized to a "raw" device file, the FD was reading the contents. Win.

But I wanted to add snapshots to that picture.

And that's when thing started getting ugly.

I thought "hey, what's more complicated than creating a snapshot before the job and removing it afterwards", right?

    File = "\\| readlink -f /dev/virt_srv1/vm1-snapshot"

in fileset definition and

  RunScript {
    Command = "lvcreate -s -L 10G -n vm1-snapshot virt_srv1/vm1-boot"
    RunsOnClient = Yes
    RunsWhen = Before
    Fail Job On Error = Yes
  }
  RunScript {
    Command = "lvremove -y virt_srv1/vm1-snapshot"
    RunsOnClient = Yes
    RunsWhen = After
    Fail Job On Error = Yes
  }

in job resource.

Looks easy.

Too bad, it doesn't work. It seems that the command for file list is executed before _any_ job scripts. Which results in readlink being executed first (which returns the unchanged pathname since there is no symlink there yet). Only then it calls the lvcreate which creates the snapshot and the symlink to the volume device. So when the actual job is run it backs up only the symlink, not its contents.

Is there any way to influence the order of those operations (make the file list generating command run afte the Before script)?

Of course, I could use the pipe plugin and do the "cat" or "dd" command on the volume but it seems ugly.

Best regards

MK

--
You received this message because you are subscribed to the Google Groups 
"bareos-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bareos-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bareos-users/72167a47-6c7a-7149-adde-a9da8ba6ce4a%40gmail.com.

Reply via email to