» Home » Docs » Release notes » Release notes for 0.3
Release notes for 0.3
Rex
Rsync interface
A simple rsync interface is now available. To use it, you need the Perl module Expect.
use Rex::Commands::Rsync;
Or, if you want to sync a remote directory to a local one
task "get-logs", "server", sub { sync "/var/log", "/tmp/logs", { download => 1 }; };
Debug mode
There is a new command line switch "-d" for debugging.
Logging
Now you can define a logging destination.
Log to a file:
logging to_file => 'rex.log';
Log to syslog:
logging to_syslog => 'local0';
Server ranges
Now you can define server ranges like "www[1..10]" or "www[01..10]".
task "uname", "www[1..10]", sub { run "uname -a"; }; or
perl group "webserver" => "www[01..15]", "web[1..3]"; task "uname", group => "webserver", sub { run "uname -a"; };
- Run command from commandline**
Example:
or with server ranges
rex -e "run 'hostname'" -H "www[01..10]" -u root -p password
or <span class="hljs-keyword">if</span> you only want to get the hostname from every <span class="hljs-number">3</span>rd server
rex -e "run 'hostname'" -H "www[01..10/3]" -u root -p password
Call tasks from other tasks**
Now you can call tasks from other tasks.
Example: perl task "hostname", "server1", "server2", sub { run "hostname"; do_task "uname"; };
task "uname", "server1", "server2", sub { run "uname -a"; }; ```
rexify
A simple command to create a Rexfile skeleton.
rexify ProjectName
This will create a Rexfile and file lib/Rex/ProjectName.pm where you can define your tasks.