autorsync

command module
v0.0.0-...-1deadb0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 24, 2020 License: GPL-3.0 Imports: 11 Imported by: 0

README

autorsync

A simple utility to automatically rsync directories in response to file change events. Similar to lsyncd, just loads simpler and less sophisticated.

Installation

go get github.com/dcrodman/autorsync

Usage

Usage of autorsync:
  -config string
        Config file (default is .autorsync)
  -logfile string
        Log file to use (default is stdout)
  -rsync string
        rsync executable to use (default /usr/bin/rsync)

By default, autorsync looks for a config file called .autorsync in the current working directory. This is expected to be a JSON-formatted file containing any settings for the tool as well as a definition of which directories to map.

Key Description
settings Object for settings that control autorsync's behavior
settings.interval The frequency with which rsync will run after a change
settings.rsync_args Additional arguments to pass to rsync
mappings Array of definitions for which files/directories to sync
mappings[].source Source directory to sync. Same rules as the SRC arg in rsync
mappings[].target Destination for the sync. Same rules as the DEST arg in rsync
mappings[].exclusions Directories in source that should be ignored while syncing

Environment variables can be used in settings.rsync_args, mappings.source, and mappings.target; their values will be set from your current session.

Example:

{
    "settings": {
        "interval": "3s",
        "rsync_args": [
            "--dry-run",
            "-e 'ssh -i ~/.ssh/some_key'"
        ]
    },
    "mappings": [
        {
            "source": "$HOME/testdir",
            "target": "127.0.0.1:/tmp/testdir",
            "exclusions": [
                ".ignoreme/",
            ]
        }
    ]
}

Documentation

Overview

dirsync is a simple utility for monitoring changes to a directory and then using the system's rsync to update the files on the target.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL