Difference between revisions of "Esmith::util::system"
(Created page with "=== NAME === esmith::util::system - replacements/wrappers for system() commands === SYNOPSIS === use esmith::util::system qw(killall rsync rsync_ssh); killall($signal, @c...") |
(→NAME) |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
=== NAME === | === NAME === | ||
esmith::util::system - replacements/wrappers for system() commands | esmith::util::system - replacements/wrappers for system() commands | ||
+ | |||
+ | see perldoc esmith::util::system | ||
=== SYNOPSIS === | === SYNOPSIS === | ||
Line 46: | Line 48: | ||
perl v5.10.1 2003-09-02 esmith::util::system(3) | perl v5.10.1 2003-09-02 esmith::util::system(3) | ||
+ | [[Category:Developer]] |
Latest revision as of 13:34, 19 June 2015
NAME
esmith::util::system - replacements/wrappers for system() commands
see perldoc esmith::util::system
SYNOPSIS
use esmith::util::system qw(killall rsync rsync_ssh);
killall($signal, @commands); rsync($src, $dest, @options); rsync_ssh($src, $dest, $user, $ident, \@rsync_opts, \@ssh_opts);
DESCRIPTION
This is for common functions that would normally require a system(...) command. Makes things easier to document, test and upgrade. If you find yourself writing a system() command, consider putting it in here.
Functions
These may be pure Perl functions or they may well just be wrappers around system() commands.
Each can be imported on request.
killall
my $killed_something = killall($signal, @commands);
Sends a $signal to all of the named @commands. $signal can be specified by name or number (so 1 or HUP for example, names are prefered). Returns true if something was killed, false otherwise.
rsync
my $success = rsync($source, $destination, @options);
rsyncs the $source file or directory to the $destination. Any @options are direct options to the rsync command.
rsync will be run --quiet by default.
Returns true if the rsync succeeds, false otherwise.
rsync_ssh
my $success = rsync_ssh($src, $dest, $user, $ident, \@rsync_opts, \@ssh_opts);
Like rsync() except it uses ssh. A typical call might be:
rsync_ssh('some.host:', 'some/file', 'someuser', 'some/.ssh/identity', [qw(--archive --delete)]);
AUTHOR
Mitel Networks Corporation
perl v5.10.1 2003-09-02 esmith::util::system(3)