1PUPPET-FILEBUCKET(8) Puppet manual PUPPET-FILEBUCKET(8)
2
3
4
6 puppet-filebucket - Store and retrieve files in a filebucket
7
9 A stand-alone Puppet filebucket client.
10
12 puppet filebucket mode [-h|--help] [-V|--version] [-d|--debug]
13 [-v|--verbose] [-l|--local] [-r|--remote] [-s|--server server]
14 [-f|--fromdate date] [-t|--todate date] [-b|--bucket directory] file
15 file ...
16
17 Puppet filebucket can operate in three modes, with only one mode per
18 call:
19
20 backup: Send one or more files to the specified file bucket. Each sent
21 file is printed with its resulting md5 sum.
22
23 get: Return the text associated with an md5 sum. The text is printed to
24 stdout, and only one file can be retrieved at a time.
25
26 restore: Given a file path and an md5 sum, store the content associated
27 with the sum into the specified file path. You can specify an entirely
28 new path to this argument; you are not restricted to restoring the con‐
29 tent to its original location.
30
31 diff: Print a diff in unified format between two checksums in the file‐
32 bucket or between a checksum and its matching file.
33
34 list: List all files in the current local filebucket. Listing remote
35 filebuckets is not allowed.
36
38 This is a stand-alone filebucket client for sending files to a local or
39 central filebucket.
40
41 Note that ´filebucket´ defaults to using a network-based filebucket
42 available on the server named ´puppet´. To use this, you´ll have to be
43 running as a user with valid Puppet certificates. Alternatively, you
44 can use your local file bucket by specifying ´--local´, or by specify‐
45 ing ´--bucket´ with a local path.
46
47
48
49 find /opt/puppetlabs/server/data/puppetserver/bucket -type f -mtime +45 -atime +45 -print0 | xargs -0 rm
50
51
52
53 · Restrict the directory to a maximum size after which the oldest
54 items are removed.
55
56
57
59 Note that any setting that´s valid in the configuration file is also a
60 valid long argument. For example, ´ssldir´ is a valid setting, so you
61 can specify ´--ssldir directory´ as an argument.
62
63 See the configuration file documentation at https://pup‐
64 pet.com/docs/puppet/latest/configuration.html for the full list of
65 acceptable parameters. A commented list of all configuration options
66 can also be generated by running puppet with ´--genconfig´.
67
68 --bucket
69 Specify a local filebucket path. This overrides the default path
70 set in ´$clientbucketdir´.
71
72 --debug
73 Enable full debugging.
74
75 --fromdate
76 (list only) Select bucket files from ´fromdate´.
77
78 --help Print this help message.
79
80 --local
81 Use the local filebucket. This uses the default configuration
82 information and the bucket located at the ´$clientbucketdir´
83 setting by default. If ´--bucket´ is set, puppet uses that path
84 instead.
85
86 --remote
87 Use a remote filebucket. This uses the default configuration
88 information and the bucket located at the ´$bucketdir´ setting
89 by default.
90
91 --server_list
92 A list of comma seperated servers; only the first entry is used
93 for file storage. This setting takes precidence over server.
94
95 --server
96 The server to use for file storage. This setting is only used if
97 server_list is not set.
98
99 --todate
100 (list only) Select bucket files until ´todate´.
101
102 --verbose
103 Print extra information.
104
105 --version
106 Print version information.
107
109 ## Backup a file to the filebucket, then restore it to a temporary directory
110 $ puppet filebucket backup /etc/passwd
111 /etc/passwd: 429b225650b912a2ee067b0a4cf1e949
112 $ puppet filebucket restore /tmp/passwd 429b225650b912a2ee067b0a4cf1e949
113
114 ## Diff between two files in the filebucket
115 $ puppet filebucket -l diff d43a6ecaa892a1962398ac9170ea9bf2 7ae322f5791217e031dc60188f4521ef
116 1a2
117 > again
118
119 ## Diff between the file in the filebucket and a local file
120 $ puppet filebucket -l diff d43a6ecaa892a1962398ac9170ea9bf2 /tmp/testFile
121 1a2
122 > again
123
124 ## Backup a file to the filebucket and observe that it keeps each backup separate
125 $ puppet filebucket -l list
126 d43a6ecaa892a1962398ac9170ea9bf2 2015-05-11 09:27:56 /tmp/TestFile
127
128 $ echo again >> /tmp/TestFile
129
130 $ puppet filebucket -l backup /tmp/TestFile
131 /tmp/TestFile: 7ae322f5791217e031dc60188f4521ef
132
133 $ puppet filebucket -l list
134 d43a6ecaa892a1962398ac9170ea9bf2 2015-05-11 09:27:56 /tmp/TestFile
135 7ae322f5791217e031dc60188f4521ef 2015-05-11 09:52:15 /tmp/TestFile
136
137 ## List files in a filebucket within date ranges
138 $ puppet filebucket -l -f 2015-01-01 -t 2015-01-11 list
139 <Empty Output>
140
141 $ puppet filebucket -l -f 2015-05-10 list
142 d43a6ecaa892a1962398ac9170ea9bf2 2015-05-11 09:27:56 /tmp/TestFile
143 7ae322f5791217e031dc60188f4521ef 2015-05-11 09:52:15 /tmp/TestFile
144
145 $ puppet filebucket -l -f "2015-05-11 09:30:00" list
146 7ae322f5791217e031dc60188f4521ef 2015-05-11 09:52:15 /tmp/TestFile
147
148 $ puppet filebucket -l -t "2015-05-11 09:30:00" list
149 d43a6ecaa892a1962398ac9170ea9bf2 2015-05-11 09:27:56 /tmp/TestFile
150 ## Manage files in a specific local filebucket
151 $ puppet filebucket -b /tmp/TestBucket backup /tmp/TestFile2
152 /tmp/TestFile2: d41d8cd98f00b204e9800998ecf8427e
153 $ puppet filebucket -b /tmp/TestBucket list
154 d41d8cd98f00b204e9800998ecf8427e 2015-05-11 09:33:22 /tmp/TestFile2
155
156 ## From a Puppet master, list files in the master bucketdir
157 $ puppet filebucket -b $(puppet config print bucketdir --section master) list
158 d43a6ecaa892a1962398ac9170ea9bf2 2015-05-11 09:27:56 /tmp/TestFile
159 7ae322f5791217e031dc60188f4521ef 2015-05-11 09:52:15 /tmp/TestFile
160
162 Luke Kanies
163
165 Copyright (c) 2011 Puppet Inc., LLC Licensed under the Apache 2.0
166 License
167
168
169
170Puppet, Inc. April 2020 PUPPET-FILEBUCKET(8)