Using the GNU Parallel
To create a cron task in bulk:
- # Host.lst is the host list
# View current cron tasks
Parallel--nonall-j0--slf host.lst "Hostname;crontab-l"
# View/var/spool/cron File
Parallel--nonall-j0--slf host.lst "Hostname;ls-l/var/spool/cron"
# Set Cron Task
Parallel--nonall-j0--SLF host.lst Echo ' "0 0 * * * cd/root/nmon;/root/nmon/nmon-f-s600-c144" >/var/spool/cron/r Oot
The--tag parameter adds a marker to the output line
- # when there is an input parameter, the tag content is the input parameter,
- # when there is no input parameter (--nonall), the tag content is sshlogin.
- Parallel--tag--nonall-j0--SLF host.lst uptime
SCP Collection Files
- Parallel-a host.lst scp ' "{}:/root/nmon/*160401*.nmon" '.
# Host.lst is the host list
# View current cron tasks
Parallel--nonall-j0--slf host.lst "Hostname;crontab-l"
# View/var/spool/cron File
Parallel--nonall-j0--slf host.lst "Hostname;ls-l/var/spool/cron"
# Set Cron Task
Parallel--nonall-j0--SLF host.lst Echo ' "0 0 * * * cd/root/nmon;/root/nmon/nmon-f-s600-c144" >/var/spool/cron/r Oot
#--tag can add tags to the output line.
# when there is an input parameter, the tag content is the input parameter,
# when there is no input parameter (--nonall), the tag content is sshlogin.
Parallel--tag--NONALL-J0--SLF host.lst uptime
http://www.bkjia.com/PHPjc/1117249.html www.bkjia.com true http://www.bkjia.com/PHPjc/1117249.html techarticle use GNU parallel to create a cron task in bulk: # HOST.LST is the host List # view current cron task parallel--nonall-j0--slf host.lst "Hostname;crontab-l" # View/var/spool/cron ...