fileq - a very simplistic queued file transfer utility
fileq -c config-file
fileq transfers files from an incoming queue (directory) to a list of destinations. Destinations can only be directories on remote hosts. The respective transfers are performed using the sftp command line utility from the OpenSSH package. After a successful transfer to all destinations, the local queue (directory) is emptied.
Usually, this tool comes in very handy for automated distribution of files to different hosts using a cron job and public key based authentication in ssh connections. For even better security in automated file transfers, use a restrictive shell like scponly and unprivileged fileq-only user accounts.
FILE(S)See the sample.conf for an example configuration file.
This tool does not do a good job at securing the queue from race conditions and alikes. It really is very simplistic!
This program is distributed under the terms of the BSD Artistic License.
Copyright (c) 2005 Paul Kremer.
Probably!
Please send patches in unified GNU diff format to <pkremer[at]spurious[dot]biz>
OpenSSH, sftp
bootinit()bootinit() will initialize some variables as well as environmental variables and load the required perl modules.
cfginit()cfginit() will initialize the configuration, depending on command line parameters.
try_to_use(use_string)graceful_die() will log the given message as error and die.
_logString() will add debugging information to message and return it. If message
is not a string, the variable will be preprocessed by Data::Dumper::Dumper().
_syslog() will send message to the system syslog facility at the specified level
if atlevel is smaller or equal than the configured loglevel. Always returns
true.
getConfigValue() returns a string for the given configuration key. It returns
undef on error. Note that this function uses the global config container,
which means that configuration needs to be initialized before using this method.
tmpDir()tmpDir() will return a temporary directory name.
mkstempt()mkstempt() will return a temporary file name. The file will have been created by
the time the method returns. This prevents any possibility of opening up an
identical file.
emptyDir() will remove all files and directories found in the specified directory
put()