Resource Listing
CommunityEnterpriseThe Bacula Enterprise Docker Plugin supports the new Plugin Listing feature of Bacula Enterprise 8.x or newer. This mode allows a Plugin to display some useful information about available Docker resources such as:
List of Docker containers name-labels
List of Docker images name-repository
List of Docker volumes
The new feature uses the special .ls command with a new plugin=<plugin> parameter. The command requires the following parameters to be set:
- client=<client>
A Bacula Client name with the docker Plugin installed.
- plugin=<plugin>
A Plugin name, which would be docker: in this case, with optional plugin parameters as described in section genericparameters.
- path=<path>
An object path to display.
The supported values for a path=<path> parameter are:
- /
to display object types available to list
- container
to display a list of containers name-labels data
- image
to display a list of images name-repository data
- volume
to display a list of volume names data
To display available object types, follow the following command example:
*.ls plugin=docker: client=docker-test-fd path=/
Connecting to Client docker-test-fd at docker-test:9102
drwxr-x--- 1 root root 0 2018-09-28 14:32:20 image
drwxr-x--- 1 root root 0 2018-09-28 14:32:20 container
drwxr-x--- 1 root root 0 2018-09-28 14:32:20 volume
2000 OK estimate files=3 bytes=0
To display the list of all available Docker containers, the following command example can be used:
*.ls plugin=docker: client=docker-test-fd path=container
Connecting to Client docker-test-fd at docker-test:9102
root root 88185293 2018-10-01 09:18:00 myubuntu -> 4d0a4fadb50d
root root 61656268 2018-10-01 09:18:00 mcache1_98 -> cb0c2e54dd00
root root 88185240 2018-10-01 09:18:00 my_docker -> 4eefcf7d61ee
root root 88185240 2018-10-01 09:18:00 amazing_hamilton -> 73ce08ad3d59
root root 88185240 2018-10-01 09:18:00 with.label -> 1f476fd3c1b1
root root 61656268 2018-10-01 09:18:00 mcache1 -> b97d4dd88063
root root 239075328 2018-10-01 09:18:00 brave_edison -> 66f45d8601ba
root root 239075391 2018-10-01 09:18:00 some-postgres -> 28e4c3a3cd27
root root 580911104 2018-10-01 09:18:00 my-ubuntu -> a6ba1cb597d5
root root 88185245 2018-10-01 09:18:00 sharp_visvesvaraya -> ce5844df6842
root root 239075391 2018-10-01 09:18:00 my-postgres -> a7c9518405e8
root root 88185240 2018-10-01 09:18:00 frosty_kowalevski -> 0f601bcb1ef5
root root 88185302 2018-10-01 09:18:00 infallible_bose -> 00571da76da6
root root 1894 2018-10-01 09:18:00 romantic_hermann -> 37285d94347a
2000 OK estimate files=14 bytes=2,038,748,444
To display the list of all available Docker images, use the following command example:
*.ls plugin="docker:" client=docker-test-fd path=image
Connecting to Client docker-test-fd at docker-test:9102
root root 61656268 2018-10-01 09:19:34 memcached:latest -> 80256dbd25ae
root root 239075328 2018-10-01 09:19:34 postgres:latest -> ac25c2bac3c4
root root 88185240 2018-10-01 09:19:34 ubuntu:latest -> 16508e5c265d
root root 1894 2018-10-01 09:19:34 hello-world:latest -> 2cb0d9787c4d
2000 OK estimate files=4 bytes=0
The container and lists display an estimated size of Docker objects. The final size of backup could be different.
All above Docker objects lists use a short (truncated) object ids during
display. It is technically plausible that you’ll get the same truncated
id for two or more objects. To properly distinguish them you can use
notrunc plugin parameter. In this case all Docker objects ids will
be displayed in full sha256 form, i.e.
*.ls plugin="docker: notrunc" client=docker-test-fd path=image
Connecting to Client docker-test-fd at docker-test:9102
(...) memcached:latest -> 80256dbd25aedb4c025d495f18e0e513dd011005726326f529c296e4141811f6
(...) postgres:latest -> ac25c2bac3c4e56f949c60ca343e1c4cd95f493db28bbf29b8ce466b4171cc8f
(...) ubuntu:latest -> 16508e5c265dcb5c05017a2a8a8228ae12b7b56b2cda0197ed5411bda200a961
(...) hello-world:latest -> 2cb0d9787c4dd17ef9eb03e512923bc4db10add190d3f84af63b744e353a9b34
2000 OK estimate files=4 bytes=0
This plugin parameter works only in plugin listing mode and does not affect any backup, estimate or restore jobs. In this case you can get Invalid parameter job error.
To display the list of all available Docker volumes, the following command example can be used:
*.ls plugin=docker: client=docker-test-fd path=volume
Connecting to Client docker-test-fd at docker-test:9102
root root 2019-07-19 18:13:41 a563ae0edf55a01a0cdb3165d854a7326f13793119a708c44a5e49bd72a0286d
root root 2019-07-19 18:13:41 aa9d3074f8c65a5afafddc6eaaf9827e99bb51f676aafaacc05cfca0188e65bf
root root 2019-07-19 18:13:41 b49a3607eb04a4d3d00ed9dc0910e12201ad85f6ca38cb8fc7b43333207203a9
root root 2019-07-19 18:13:41 bd80f277bd000d493dde4de763b0e82f1c0d5fd760acc07cb5c971f74a314471
root root 2019-07-19 18:13:41 c0a478d317195ba27dda1370b73e5cb94a7773f2a611142d7dff690abdcfdcbf
root root 2019-07-19 18:13:41 e3f25066e7957a12f084de87686c37fdb954ab2c15068369d887d3718b860a4c
root root 2019-07-19 18:13:41 my-vol
root root 2019-07-19 18:13:41 testvolume
2000 OK estimate files=8 bytes=0
The volume list display a volume real size if this information is available from Docker else it display simple 0. The final size of backup could be different.
Go back to: Docker: Operations.