filedist [ -f ] [ -t host_1,host_2,host_n ] file ...
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.
See also resolve_targetlist(3) to see how to efficiently create a hostlist in scripts.
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
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
echo "host-001 host-002 \n" | \ filedist /etc/hosts
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
If filedist is used as another user as root, the own user is used for the distribution.
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.