LinuxCommandLibrary

mutagen

Synchronize code quickly between local and remote

TLDR

Start a synchronization session between a local directory and a remote host

$ mutagen sync create --name=[session_name] [/path/to/local/directory/] [user]@[host]:[/path/to/remote/directory/]
copy

Start a synchronization session between a local directory and a Docker container
$ mutagen sync create --name=[session_name] [/path/to/local/directory/] docker://[user]@[container_name][/path/to/remote/directory/]
copy

Stop a running session
$ mutagen sync terminate [session_name]
copy

Start a project
$ mutagen project start
copy

Stop a project
$ mutagen project terminate
copy

List running sessions for the current project
$ mutagen project list
copy

SYNOPSIS

mutagen [OPTIONS] COMMAND [COMMAND ARGUMENTS]

PARAMETERS

sync create
    Creates a new synchronization session between the local and the remote .

sync list
    Lists all active synchronization sessions.

sync status
    Displays the status of a specific synchronization session identified by its name.

sync terminate
    Terminates a specific synchronization session.

copy create
    Creates a one-time file copy from the local to the remote .

--version
    Displays the Mutagen version.

--help
    Displays help information.

DESCRIPTION

Mutagen is a command-line tool and library designed for fast, real-time, bi-directional file synchronization between local and remote filesystems. It excels in scenarios where standard tools like `rsync` are too slow due to high latency or complex directory structures. Mutagen is particularly useful for developing applications within containers or virtual machines, enabling rapid iteration and code updates without the delays associated with traditional file transfer methods.

It works by monitoring file system changes on both ends and propagating those changes in near real-time, while also resolving conflicts in a safe and predictable manner. Mutagen optimizes data transfer by using advanced techniques such as compression, delta transfer, and parallelization to minimize latency and maximize throughput. This makes it a powerful tool for developers working on large projects or those requiring immediate feedback on code changes in remote environments.

CAVEATS

Mutagen requires a Mutagen daemon to be running on both the local and remote systems. The remote system must be accessible over SSH or another supported protocol. Conflict resolution is handled automatically, but it's important to understand the conflict resolution strategies to avoid unintended data loss.

SYNCHRONIZATION URIS

Synchronization URIs define the location and access method for the remote directory. They typically follow the format `ssh://@:/` or `docker:///`. Understanding the correct URI format is crucial for establishing successful synchronization sessions.

CONFLICT RESOLUTION

Mutagen's conflict resolution strategies are designed to be safe and predictable, favoring local changes by default. It's important to understand these strategies to prevent unintended overwrites or data loss. Consult the Mutagen documentation for detailed information on conflict resolution behavior.

HISTORY

Mutagen was developed to address the performance limitations of existing file synchronization tools in latency-sensitive development environments. It aims to provide a more responsive and efficient solution for sharing code and data between local and remote systems, particularly in the context of containerized or virtualized development workflows. Its development is driven by the need for faster feedback loops in software development.

SEE ALSO

rsync(1), scp(1), ssh(1)

Copied to clipboard