Jan Gehring > Rex-0.44.6.1 > Rex::Commands::Rsync

Download:
Rex-0.44.6.1.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  5
Open  1
View/Report Bugs
Source   Latest Release: Rex-0.50.0

NAME ^

Rex::Commands::Rsync - Simple Rsync Frontend

DESCRIPTION ^

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

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',
    };
 };
syntax highlighting: