NAME

Rex::Commands::Rsync - Simple Rsync Frontend

DESCRIPTION

With this module you can sync 2 directories via the rsync command.

Version <= 1.0: All these functions will not be reported.

All these functions are not idempotent.

DEPENDENCIES

Expect

SYNOPSIS

use Rex::Commands::Rsync;

sync "dir1", "dir2";

EXPORTED FUNCTIONS

sync($source, $dest, $opts)

This function executes rsync to sync $source and $dest.

UPLOAD - Will upload all from the local directory html to the remote directory /var/www/html.
task "sync", "server01", sub {
  sync "html/*", "/var/www/html", {
   exclude => "*.sw*",
   parameters => '--backup --delete',
  };
};

task "sync", "server01", sub {
  sync "html/*", "/var/www/html", {
   exclude => ["*.sw*", "*.tmp"],
   parameters => '--backup --delete',
  };
};
DOWNLOAD - Will download all from the remote directory /var/www/html to the local directory html.
task "sync", "server01", sub {
  sync "/var/www/html/*", "html/", {
   download => 1,
   parameters => '--backup',
  };
};