rmirr provides a safe and easy to use way to set up and execute file storage mirroring instructions. And because it uses rsync to actually perform the synchronization, you get all the performance and availability benefits of rsync.


Why not just use rsync directly?

Simple cases of mirroring files/directories can easily be done by using rsync directly. But, it does not provide any safeguards. For example, the following are not the same:

rsync -avz --delete /a/b/c mach2:/a/b/c


rsync -avz --delete /a/b/c/ mach2:/a/b/c

Assuming a directory is being synced, call #2 is correct, as it uses a trailing / on the source path. rmirr ensures that will be done properly.


usage: rmirr [<options>] [-n <name>] -p <path>
       rmirr [<options>] [-n <name>] -s <suitename>
       rmirr [<options>] -n <name>
       rmirr -l

Mirror file objects which can be specified by <path> (for which a
mirror is selected), <suite> (representing one or more paths), or
<name> (a mirror configuration).

-l      List mirror configurations.
-n <name>
        Mirror name.
-p <path>
        Mirror path.
-s <suitename>
        Alias for one or more paths.

-c <path>
        Location of paths.json configuration file.
-d <hostname>[,...]
        Destinations to mirror to from list in configuration.
        Enable debugging.
        Allow file object deletion.
--dry   Dry run. Do not execute.
        Dry run for rsync.
--mailto <emailaddr>[,...]
        Set/override recipients when mailing report.
        Mail report.
        Do not use/require lock to run.
        Disable safemode.
        Show report on console.
        Enable verbosity.
-y      Do not ask for confirmation before executing.


Configuration file is located at ~/.rmirr/rmirr.json.

Section Name Description
defaults email_recipients List of email recipients when --mailreport is used.
smtp_server Set SMTP server. Default is to use "localhost".
suites <suitename> List of paths to be mirrored.
mirrors comment Description of what is being mirrored.
destinations List of destinations to which the source is to be mirrored each of the format [<user>@]]<host>:<path>.
email_recipients List of email recipients when --mailreport is used. Overrides the value from the defaults section.
excludes List of file/dir names to exclude from the mirroring.
name Mirror configuration name.
source Source of the mirror: [<user>@]<host>:<path>.


Given the configuration at ~/.rmirr/rmirr.json:

 "defaults": {
  "email_recipients": []
 "suites": {
  "all": [
 "mirrors": [
   "name": "data-main--home--finance-hr",
   "comment": "data main: home -> finance, hr",
   "source": "",
   "excludes": [".snapshot", ".snapshots"],
   "destinations": ["", ""]
   "name": "data-finance--home--finance",
   "comment": "data finance: home -> finance",
   "email_recipients": [""],
   "source": "",
   "excludes": [".snapshot", ".snapshots"],
   "destinations": [""]
   "name": "data-hr--home--hr",
   "comment": "data hr: home -> hr",
   "source": "",
   "excludes": [".snapshot", ".snapshots"],
   "destinations": [""]

List suite and mirror settings:

rmirr -l

Mirror /data/main from

rmirr -p /data/main


Show what rmirr would do without executing it (dry-run):

rmirr --dry -p /data/main

Mirror /data/main/opt:

rmirr -p /data/main/opt


Mirror /data/finance and allow deletion at the destination:

rmirr --delete -p /data/finance

Do a dry run (at rsync level) to mirror /data/finance with deletion and no user interaction:

rmirr --dry-rsync --delete -y -p /data/finance

Mirror /data/main to specific destination (

rmirr --delete -y -d -p /data/main

Request report be emailed:

rmirr -p /data/main --mailreport

Request report be output to console:

rmirr -p /data/main --showreport

Mirror the "all" suite:

rmirr -s all

Mirroring Selected File Objects

Sometimes only a subset of file objects (files, directories) need to be mirrored rather than a full tree. rmirr supports this with the names setting in the configuration file.

Configuration for mirroring bash files:

 "suites": {
  "bashfiles": [
 "mirrors": [
   "name": "my-bash-files",
   "comment": "my .bash files",
   "source": "",
   "excludes": [
   "destinations": [


To mirror all the file objects of the bashfiles suite:

rmirr -s bashfiles

To mirror specific file objects:

rmirr -p /home/jdm/.bash_completion.d

Ⓒ 2023 | Powered by rudiweb.