@@ -247,6 +247,25 @@ that it is simply discarded. This allows the use of the same mysql profile on
247
247
both production and test machines, with backups only on the production machines
248
248
that are also rsnapshot clients.
249
249
250
+ ### Back Up Pre and Post Actions
251
+
252
+ When backing up clients hosting services like databases, you may want to run a
253
+ script to snapshot or quiesce the service. You can do this by specifying pre
254
+ or post wrapper actions. These will be run on the client immediately before or
255
+ after the rsync operation.
256
+
257
+ For example, to export the contents of the puppetdb database before running a
258
+ backup of your puppetmaster:
259
+
260
+ ``` puppet
261
+
262
+ class profiles::puppetmaster {
263
+ rsnapshot::client {
264
+ cmd_wrapper_preexec => ['/usr/sbin/puppetdb export -o /root/puppetdb.export --port 8083'],
265
+ cmd_wrapper_postexec => ['rm -f /root/puppetdb.export'],
266
+ }
267
+ }
268
+ ```
250
269
251
270
### Backing Up Machines Outside of Puppet
252
271
@@ -373,6 +392,8 @@ resource to the backup server.
373
392
to fqdn_rand, giving each host a random weekday for backups.
374
393
* ` backup_time_dom ` : The day of the month that monthly backups should occur.
375
394
This defaults to fqdn_rand, giving each host a random day of the month.
395
+ * ` cmd_wrapper_preexec ` : Array of commands to run on client before backups.
396
+ * ` cmd_wrapper_postexec ` : Array of commands to run on client after backups.
376
397
* ` cmd_preexec ` : The path to any script that should run before backups.
377
398
* ` cmd_postexec ` : The path to any script that should run after backups.
378
399
* ` cmd_client_rsync ` : The path to the client side rsync binary.
0 commit comments