You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
krimdomu edited this page Jan 24, 2011
·
1 revision
To transparently manipulate files you can require the (R)?ex Module Rex::Commands::File.
use Rex::Commands::File;
user "myuser";
password "mypass";
desc "Show the syslog";
task "syslog", "server1", "server2", sub {
my $file_handle = file_read "/var/log/syslog";
print $file_handle->read_all;
};
desc "Create a testfile";
task "testfile", "server1", "server2", sub {
my $file_handle = file_write "/tmp/my-test-file.txt";
$file_handle->write("This is my testfile\n");
$file_handle->close;
};