execute, log, and kill programs and sync files on multiple servers concurrently and automatically
fill in the following local variables in the script according to your requirement:
- myuser: your username in the server
- mypasswd: your password for ssh access
- mydocker: your docker name to access
- SSH_LIST: your server list
- cmd: your commands to execute on remote servers
- key_word: keywords to grep your pids to kill
- RE_DIR: remote directory to sync your file
bash sync_exec.sh startbash sync_exec.sh dockerbash sync_exec.sh stopbash sync_exec.sh fileexecute sudo commands on the server without typing passwords:
sudo vi /etc/sudoersadd the following line:
username ALL=(ALL:ALL) NOPASSWD:ALLadd the following line in the beginning of your own script if necessary
cd $(dirname $0)