File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ MULTIHOSTEXEC_HOSTLIST_FILE=template-multihost-hosts.lst
2+ nHostListCount=` grep -v " ^$\|#" $MULTIHOSTEXEC_HOSTLIST_FILE 2> /dev/null | wc -l`
3+ arrHostList=` grep -v " ^$\|#" $MULTIHOSTEXEC_HOSTLIST_FILE 2> /dev/null`
4+ if [ ! -s $MULTIHOSTEXEC_HOSTLIST_FILE -o ! -r $MULTIHOSTEXEC_HOSTLIST_FILE -o $nHostListCount -eq 0 ]; then
5+ echo " Error: Cannot read host file/file is empty."
6+ exit 1
7+ fi
8+ echo " Found $nHostListCount hosts."
9+ nHostIndex=0
10+ for nHost in $arrHostList
11+ do
12+ nHostIndex=` expr $nHostIndex + 1`
13+ echo " Processing [$nHostIndex of $nHostListCount ] $nHost ."
14+ ssh -q -T $nHost << -'ENDSSH '
15+ ENDSSH
16+ strRemoteFileName=" /some/remote-folder/*$( date +%Y%m%d) .tar.gz"
17+ echo " On LOCAL - Downloading remote file $nHost :$strRemoteFileName $strRemoteFileName ."
18+ scp -q $nHost :$strRemoteFileName
19+ test $? && echo " On LOCAL - File download complete!"
20+ done
21+ echo " Complete!"
You can’t perform that action at this time.
0 commit comments