# grunt-multisync

> syncing multiple folder pairs across drives/locations

Latest version **1.0.1** (published 2013-07-28) · 0 weekly downloads

## Install

```sh
npm install grunt-multisync
pnpm add grunt-multisync
yarn add grunt-multisync
bun add grunt-multisync
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2013-07-28 |
| First published | 2013-07-27 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.8.0 |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| Author | Jae Task |
| Maintainers | jaetask |
| Keywords | rsync, multi, site, grunt, gruntplugin |

## Links

- npm: https://www.npmjs.com/package/grunt-multisync
- Repository: https://github.com/jaetask/multisync
- Issues: https://github.com/jaetask/multisync/issues
- npm.io page: https://npm.io/package/grunt-multisync

## Dependencies (3)

- [underscore](https://npm.io/package/underscore.md) ~1.5.1
- [grunt-rsync](https://npm.io/package/grunt-rsync.md) ~0.2.0
- [rsyncwrapper](https://npm.io/package/rsyncwrapper.md) 0.0.13

## Recent versions

- 1.0.1 (latest) — 2013-07-28
- 0.1.8 — 2013-07-28
- 0.1.7 — 2013-07-28
- 0.1.6 — 2013-07-27
- 0.1.5 — 2013-07-27
- 0.1.4 — 2013-07-27
- 0.1.3 — 2013-07-27
- 0.1.2 — 2013-07-27
- 0.1.1 — 2013-07-27

## README

# grunt-multisync

> syncing multiple folder pairs across drives/locations

## Getting Started
This plugin requires Grunt `~0.4.1`

If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

```shell
npm install grunt-multisync --save-dev
```

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

```js
grunt.loadNpmTasks('grunt-multisync');
```

## The "multisync" task

### Overview
In your project's Gruntfile, add a section named `multisync` to the data object passed into `grunt.initConfig()`.

```js
grunt.initConfig({
  multisync: {
    options: {
        drives: {
            InstallLocation: "~",
            MyHardDrive: "/Users/MyUserName",
            MyBackupDrive: "/Volumes/MyBackupDrive",
            MyOtherDrive: "/Volumes/MyOtherDrive",
            MySpareDrive: "/Volumes/MySpareDrive",
        }
    },
    // Configure a job to back up multiple folder pairs from one drive to another
    laptop: {
        drives: {
            src:    '<%= multisync.options.drives.MyHardDrive %>',
            dest:   '<%= multisync.options.drives.MyBackupDrive %>'
        },
        folders: {
            {src: '/TestFolder/', dest: '/test-folder', recursive: false},
            {src: '/TestFolder2/', dest: '/TestFolder2'},
            {src: '/NamesDontHave/', dest: '/_to_be__the_same_'},
        },
        options: {
            // any rsyncwrapper options here get allpied to ALL folder pairs
            recursive: true,
            dryRun: false
        }
    }
  },
})
```

### Drives

Drive is a list of drives (or folders) that you want to copy files from or to.
In the example config we have two drives configured, a local hard drive 'MyHardDrive' and
a backup hard drive MyBackupDrive. In the next section where you configure a sync 'job' you can reference
these drives like this.

You can specify a "~" if you want to start in the current working directory of your plugin

```js
grunt.initConfig({
  multisync: {
    options: {
        drives: {
            MyHardDrive: "/Users/MyUserName",
            MyBackupDrive: "/Volumes/MyBackupDrive"
        }
    },
    macbook: {
      drives: {
        src: '<%= multisync.options.drives.MyHardDrive %>',
        dest: '<%= multisync.options.drives.MyBackupDrive %>'
      }
    }
  }
})
```

### Folders

Because multisync consumes the grunt-rsync plugin which uses rsyncwrapper, it exposes all of the options
that are available in rsyncwrapper.

```js
grunt-multisync
    grunt-rsync
        rsyncwrapper
```

Please see the rsyncwrapper plugin documentation for more info at https://github.com/jedrichards/rsyncwrapper/


### Options

Options are globally copied into all of the folder pairs.
When an option is already set in an individual folder pair the global option is ignored.


## Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).

## Release History
V1.0.0 is coming today :)

---
_Source: https://npm.io/package/grunt-multisync · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
