Skip to content


Subversion checkout URL

You can clone with
Download ZIP
A gruntplugin which copies files to a (remote) machine with rsync.
JavaScript Erlang
Branch: grunt-4.0
Pull request Compare This branch is 4 commits ahead, 20 commits behind master.

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.


Copy files to a (remote) machine running an SSH daemon with 'rsync'.

See also:

Getting Started

rsync has to be installed on the local and remote system. rsync must be able to connect to the host without password (e.g. public key authentication)

Install with: npm install grunt-rsync-2

Inside your grunt.js file add :


and a task named rsync (see Configuration)!


Add a configuration like this:

  rsync: {
        deploy: {
          src: 'dist/',
          options: {
            host      : "",
            port      : "1023",
            user      : "jdoe",
            remoteBase: "~/production"

This will transfer the content of the dist/ directory (relative to the current directory) to the host directory ~/production (relative to the user home) on the host logged in with jdoe.

:exclamation: Files on the remote machine will be overridden

File option: files

This option follows the grunt-0.4 file option specs ( For more dedicated description see the following examples:


Simple file-descriptor:
rsync: {
  deploy: {
    src: 'dist/**/*.jpg' // globbing

selects all jpg-images from all directories in dist

Mapping single file-descriptor:
rsync: {
  deploy: {
    files: {'images/' : 'dist/**/*.jpg'} // map <String>:<String>
    options: {
      remoteBase: "~/production"

selects all jpg-images from all directories in dist to remote ~/production/images/

Mapping multiple file-descriptor:
rsync: {
  deploy: {
    files: {'images/' : ['dist/images/*.jpg', 'dist/img/*.jpg']} // map <String>:[<String>]
    options: {
      remoteBase: "~/production"

selects all jpg-images from images and img directories in dist to remote ~/production/images/

rsync options: options

  • host: the hostname or ip (ip4/ip6). Default: localhost
  • port: the port of the ssh server on the host. Default: 22
  • user: the user name on the remote to log in with.
  • remoteBase: the path from root (defined by the ssh server) to the directory to place the content in. Default: ~
  • preserveTimes: keeps the origin timestamp. Default: false
  • preservePermissions: keeps the rights. Default: true
  • compression: transfer with compression. Default: true
  • recursive: transfer the source directory recursivly Default: true
  • additionalOptions: rsync commandline arguments (see man rsync) Default: ''

Release History

  • 0.2.0 : grunt 0.4 support and major changes
    • multithreaded async rsync for every file entry in file map
    • fixed rsync sysout capture
  • 0.1.1 : initial release to github and npm


Copyright (c) 2012-2013 Jan-Philip Loos Licensed under the MIT license.

Something went wrong with that request. Please try again.