MRB(8)

πŸ’Ύ MRB β€” the manual page, bestie edition πŸ’Ύ

okay so you found the mrb(8) page β€” it lives in the System Manager's Manual section, which is the fancy way of saying "root stuff, admin vibes, main character energy for sysadmins." 🫢


✨ NAME ✨

mrb β€” manage incremental snapshots with rsync/make.

yes that's literally the whole name section, she's brief and she's iconic πŸ’…


🌈 SYNOPSIS 🌈

mrb command

that's it. one command. no flags hanging off the front. slay. ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so mrb is a simple little helper for making efficient incremental snapshots of a set β€” or sets β€” of directories, like, whenever you feel like it. no cap. πŸ’–

it's the kind of thing you can drop into a regular automated backup regime and just let it cook, OR you can run it by hand when you wanna manually checkpoint your changes at a convenient moment in time. both are valid. both are a vibe. πŸŽ€


πŸ‘‘ COMMANDS πŸ‘‘

here's the thing β€” every command below uses MODULE, which is just the name of one of your snapshot definitions. plug yours in and go. 🫢

  • new-MODULE β€” makes a skeleton definition for a brand new snapshot called MODULE. it's giving "blank canvas, first draft, we begin." ✨
  • dest-MODULE β€” creates the destination dir for MODULE. and like, heads up: this directory must already exist before you can create a snapshot. it's non-negotiable bestie. 😭
  • snap-MODULE β€” creates an actual snapshot of MODULE. the moment we've all been waiting for. πŸ’–
  • sync β€” creates snapshots of ALL your defined modules at once. and ooh β€” if you run it as root</>, it can be configured to include the modules of other users too (peep MRB_SYNC_USERS in ~/.mrb/defaults). multi-user slay. πŸ‘‘
  • help β€” shows mrb's own help text. when in doubt, ask the girl herself. 🌸

πŸŽ€ CONFIGURATION FILES πŸŽ€

🧚 Per-user configuration

these files are where you drop global and local config options. use them. they're useful. no cap.

  • /etc/default/mrb β€” the system default configuration. the OG, the blueprint. 🌈
  • ~/.mrb/defaults β€” your per-user configuration. this is YOUR house, YOUR rules. πŸ’…

πŸ’œ Per-user options

these ones control how things behave for all of a user's modules at once. group settings, basically. 🫢

  • MRB_SNAPSHOT_LOG β€” an optional file path where transfer details get recorded. if it's unset, those details simply won't be logged. your call bestie. πŸ“
  • MRB_SYNC_USERS β€” a space separated list of users whose modules should get included in a sync. mostly this is a root-only flex, because mrb will assume the identity of each user before snapshotting their modules. if it's unset, only the invoking user's modules get sync'ed. periodt. πŸ‘‘
  • MRB_CONFDIR β€” a space separated list of directories to search for module definition (*.mrc) files. they get searched in the order given, and new modules get added by default to the last one listed. honestly? there should be very few reasons to change the default value. leave her alone. πŸ™ˆ

🌸 Per-module configuration

the default MRB_CONFDIR value goes looking for module definitions in these two spots:

  • /etc/mrb/*.mrc β€” the system-wide spot. πŸ›οΈ
  • ~/.mrb/*.mrc β€” and this is the one β€” those created by new-MODULE land in this latter location by default. πŸŽ€

⭐ Per-module options

okay so in every single one of these, module means the name of the particular module the value applies to. these options go in a file named module.mrc. πŸ“

  • module_SRC β€” a space separated list of the files and (top level) directories to include in the snapshots for this module. and yes, these can be remote urls. travel broadens the mind. 🌍
  • module_DEST β€” the (local) directory root where snapshots of module get stored. keep it local, keep it cute. 🏠
  • module_INCLUDE β€” an optional list of rsync(1) include patterns. ✨
  • module_EXCLUDE β€” an optional list of rsync(1) exclude patterns. bye girl πŸ‘‹
  • module_FILTER β€” an optional list of rsync(1) filter patterns. 🧚
  • module_FILTER_FILE β€” an optional filename for rsync(1) dir-merge filtering support. iykyk. πŸ’…
  • module_RSYNC_OPTIONS β€” optional additional rsync(1) options passed verbatim when it gets invoked. verbatim means verbatim, don't get creative. 🫢
  • module_PRECOMMAND β€” an optional shell command to run just before creating a new snapshot. and listen: if that command doesn't return a successful exit status, the snapshot creation gets aborted before it even begins. it's handy for mounting removable media or similar. no snapshot on a bad vibe. πŸ›‘
  • module_POSTCOMMAND β€” an optional shell command to execute after making the snapshot. heads up though: it won't be called if the snapshot creation failed at an earlier stage, and its return status may halt a sync operation if it fails while there are still more modules to process. you could use it to unmount removable media again, for example. 🧹
  • module_USER β€” an optional user name to check that mrb is running as, before performing a snapshot. this is how you make sure you've got the correct permission to access the files being mirrored before you get too far. check yourself before you wreck yourself. πŸ’…

πŸ”— SEE ALSO πŸ”—

rsync(1), make(1).

the holy trinity honestly πŸ™


πŸ’– AUTHOR πŸ’–

mrb was written by Ron <ron@debian.org>. king behaviour. πŸ‘‘


and that's the whole page bestie β€” MRB(8) from the System Manager's Manual, dated May 9, 2006, and yes she's an old queen but she still eats πŸ’…βœ¨ go make some snapshots, you've got this πŸ«ΆπŸŽ€

πŸ“¦ where this page comes from