This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
HOSTS="host1 host2 host3 host4" | |
RETENTION_TIME=14 | |
echo "$(date) - Log Cleaner - $RETENTION_TIME days - $HOSTS" >> /var/log/hadoop_log_cleaner.log | |
for host in $HOSTS | |
do | |
ssh root@$host << ENDSSH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Create file "server.txt" | |
## then write all the server addr, and import ssh key to all server. | |
# example | |
for i in `cat server.txt`; do ssh root@${i} "Try Linux command"; done | |
# Check status SELinux | |
for i in `cat server.txt`; do ssh root@${i} "hostname && sestatus"; done | |
# Check IP Address |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#cloud-config | |
users: | |
- default | |
- name: user-01 | |
gecos: Regular user | |
sudo: ["ALL=(ALL) NOPASSWD:ALL"] | |
groups: wheel | |
chpasswd: | |
list: | | |
root:p@ssw0rd! |
NewerOlder