filedist

Package: WA2L/edrc 1.5.57
Section: General Commands (1)
Updated: 21 September 2009
Index Return to Main Contents

 

NAME

filedist - distribute file(s) to a list of remote systems

 

SYNOPSIS

edrc/bin/filedist [ -h ]

filedist [ -f ] [ -t host_1,host_2,host_n ] file ...

 

AVAILABILITY

WA2L/edrc

 

DESCRIPTION

Distribute given file(s) to an interactively queried list of hosts.

The file(s) are distributed to the identical path as they are located on the source system.

The interactive query of hosts suggests as default the hosts as defined in the DIST_HOSTLIST setting in the rcmd.cfg file. Furthermore it is possible to enter hostgroups ( @HOSTGROUP ), as known from the hostlist command. It is possible to specify multiple hostgroups or to mix hostgroups with hostnames. When using hostgroups the input default is expanded and the target prompt is repeated to give the user the opportunity to verify the target list and to correct it if needed.

The host where logged on is excluded from distribution even if it is on the target list.

It is possible to block files from being distributed from or to certain hosts. The blocking rules are specified in the etc/filedist.block file. The intention of blocking files is to avoid miss-configurations etc. by distributing files to/from certain hosts by error.

 

OPTIONS

-h
usage message.

-f
force distribution of files blocked as defined in etc/filedist.block.

-t hostlist
A comma separated list of target hosts. If the hostlist is not specified, an interactive query asks for it.

See also resolve_targetlist(3) to see how to efficiently create a hostlist in scripts.

file ...
space separated list of files to be distributed to one or more target systems. The file(s) are distributed to the identical path ad it resides on the source system. Directories and symbolic links are not accepted as source in the file option. When the file intended to be distributed is a directory or symbolic link on the target system it will not be distributed to that system and a error message is displayed. Also if a file is located in a directory on the source system but the directory does not exist on the target system, it is not distributed and an error message will inform about this.

 

ENVIRONMENT

-

 

EXIT STATUS

0
no error.

2
operating system is not supported, yet. See osid(3) if you get this error.

4
usage printed.

5
the distribution has been aborted using Ctrl+C.

6
the configuration file filedist.cfg does not exist.

7
the blockfile filedist.block does not exist.

11
temporary directory could not be claimed or created in /tmp. Check the system temporary directory /tmp if you get this error, it is an indicator of system intrusion.

 

FILES

etc/filedist.cfg
configuration file of filedist, see filedist.cfg(4) for more information.

etc/filedist.block
configuration file of filedist to prevent (block) files from being distributed from/to certain targets, see filedist.block(4) for more information.

var/log/filedist.log
default logfile of filedist.

 

EXAMPLES

1) normal target list

Distribute files to a list of targets. In this example the file /etc/protocol does not exist on the source node. The file /etc/init.d is a directory. On the system dcdbsi63 the file /etc/telnetd is a symbolic link, therefore the file is not distributed from the source node to this host.

[ /etc ]
[ root@dcdbsi74 ][-sh]: filedist hosts services protocol telnetd init.d
filedist - copy files to other systems, by Chr. Walther

Target hosts: [ dcdbsi63 dcdbsi64 dcdbsi73 dcdbsi74 ]:

distribute files ...
    host dcdbsi63 ...
        file /etc/hosts ... done
        file /etc/services ... done
        file protocol ...(not found)... skip
        file /etc/telnetd ...(link)... skip
        file init.d ...(not found)... skip
    done
    host dcdbsi64 ...
        file /etc/hosts ... done
        file /etc/services ... done
        file protocol ...(not found)... skip
        file /etc/telnetd ...(link)... skip
        file init.d ...(not found)... skip
    done
    host dcdbsi73 ...
        file /etc/hosts ... done
        file /etc/services ...(target is link)... fail
        file protocol ...(not found)... skip
        file /etc/telnetd ...(link)... skip
        file init.d ...(not found)... skip
    done
    host dcdbsi74 ...(localhost)... skip
done

2) target list using hostgroups

Distribute files to a list of targets using hostgroups. In this example the file /etc/hosts is blocked to be distributed to the host dcdbsi50. The host dcdbsi99 is not up.

[ / ]
[ root@dcdbsi70 ][-sh]: filedist /hosts/hosts
filedist - copy files to other systems, by Chr. Walther

Target hosts: [ dcdbsi60 dcdbsi70 ]: @ALL dcdbsi50 dcdbsi99
Target hosts: [ dcdbsi05 dcdbsi10 dcdbsi20 ... dcdbsi73 dcdbsi74 dcdbsi99 ]:

distribute files ...
    host dcdbsi05 ...
        file /etc/hosts ... done
    done
    host dcdbsi10 ...
        file /etc/hosts ... done
    done
    :
    :
    host dcdbsi33 ...
        file /etc/hosts ... done
    done
    host dcdbsi50 ...
        file /etc/hosts ...(blocked)... skip
    done
    host dcdbsi51 ...
        file /etc/hosts ... done
    done
    :
    :
    host dcdbsi64 ...
        file /etc/hosts ... done
    done
    host dcdbsi70 ...(localhost)... skip
    host dcdbsi71 ...
        file /etc/hosts ... done
    done
    :
    :
    host dcdbsi74 ...
        file /etc/hosts ... done
    done
    host dcdbsi99 ...(not up)... skip
done


3) use filedist in scripts (host only targetlist)

echo "host-001 host-002 \n" | \
  filedist /etc/hosts

4) use filedist in scripts (hostgroups in targetlist)

echo "`resolve_targetlist -t host-001 host-002 @BE` \n" | \
  filedist /etc/hosts

or:

echo "host-001 host-002 @BE \n\n" | \
  filedist /etc/hosts

 

SEE ALSO

edrcintro(1), edrcsetup(1m), hostaliases(3), remote_shell(3), remote_copy(3), filedist.cfg(4), filedist.block(4), resolve_targetlist(3), hostlist(3)

 

NOTES

When distributing files as user root from the source system, the user as defined in DIST_USER in the configuration file etc/filedist.cfg is used to connect to the target systems. On the target systems this user has to be allowed to switch to root in the related security files, see edrcsetup(1m) for an explanation of the required security settings.

If filedist is used as another user as root, the own user is used for the distribution.

 

BUGS

-

 

AUTHOR

filedist was developed by Christian Walther. Send suggestions and bug reports to wa2l@users.sourceforge.net .

 

COPYRIGHT

Copyright © 2009 Christian Walther

This is free software; see edrc/doc/COPYING for copying conditions. There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


 

Index

NAME
SYNOPSIS
AVAILABILITY
DESCRIPTION
OPTIONS
ENVIRONMENT
EXIT STATUS
FILES
EXAMPLES
SEE ALSO
NOTES
BUGS
AUTHOR
COPYRIGHT

This document was created by man2html using the manual pages.
Time: 00:14:03 GMT, March 08, 2025