Storage->Device->Mount Command: Exit Codes?

51 views
Skip to first unread message

Leo L. Schwab

unread,
Dec 31, 2023, 7:03:15 PM12/31/23
to bareos-users
I am toying with creating a migration pool/job to an external USB drive.  So "obviously" one would create a Storage Device along the lines of:

Device {
    Name                    = "full-archive-ext"
    Media Type              = file-extusb
    Device Type             = file

    Archive Device          = /dev/something
    Requires Mount          = yes
    Mount Point             = /mnt/somewhere
    Mount Command           = "/sbin/mount %a %m"
    Unmount Command         = "/sbin/umount %m"
    [ ... ]

As it turns out, a straight `mount` won't work in my case because Bareos is running as not-root inside a TrueNAS/FreeBSD jail, whose storage is a ZFS dataset nullfs-mounted into the jail.  So the best I can do is write a script that tests to see if the mount is in place and writeable.

So: What exit codes are recognized from scripts/commands invoked via `Mount Command` and `Unmount Comand`?  If these scripts/commands return failure, how will Bareos respond?  Abort the job?  Log a warning and attempt the job anyway?  Some documentation on this would be nice.

Thanks in advance,
Schwab

Reply all
Reply to author
Forward
0 new messages