NAME

fileq - a very simplistic queued file transfer utility


SYNOPSIS

fileq -c config-file


DESCRIPTION

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.


OPTIONS

-c, --config-file file
Specify a config file.

-h, --help
Displays this help

-V, --version
Display version and exit


CONFIGURATION FILE(S)

See the sample.conf for an example configuration file.


NOTES

This tool does not do a good job at securing the queue from race conditions and alikes. It really is very simplistic!


LICENSE

This program is distributed under the terms of the BSD Artistic License.


AUTHOR

Copyright (c) 2005 Paul Kremer.


BUGS

Probably!

Please send patches in unified GNU diff format to <pkremer[at]spurious[dot]biz>


SEE ALSO

OpenSSH, sftp


Function documentation

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)
will eval ``use use_string'' and return undef if it worked. Otherwise returns the exception text.

graceful_die(string message)
graceful_die() will log the given message as error and die.

_logString(mixed message)
_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().

_logIt(mixed message, int atlevel)
will format and log the message if atlevel is smaller or equal than the configured loglevel. Returns the logged message if it got logged.

log*(mixed message)
log*() will log the message at the corresponding LOGLEVEL and return the logged message, if it was logged.

_syslog(string message, int atlevel)
_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(string key)
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.

version
Prints version information and exits.

help
Feeds this script to `perldoc`

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(string directory)
emptyDir() will remove all files and directories found in the specified directory

put()
TODO