I have a server that needs to send daily some files to remote machines.
I have done this script in order to automate this task.
What I need to insert on this script in order to see if this task as been successfully done?
Both tasks, the first task that sends the files and the other task that forces a reboot on that machine.
#!/bin/sh for server in `more server-list.txt` do sshpass -p password scp -r /root/list/*.* root@$server:/etc/list/ done sleep 5 for server in `more server-list.txt` do sshpass -p password ssh root@$server /sbin/reboot done
#server-list.txt 10.29.0.32 10.29.0.4 10.29.0.11 10.29.0.12 10.29.0.13 10.29.0.14
After I execute the following command to run the script, I only have following output
Sometimes I have a error saying that the host had timeout connection, but don't tell me which one has failed and I don't know which one as rebooted successfully