I need to reboot a number of machines remotely. Normally I just issue
for host in <hostlist>;do ssh ${host} 'sudo shutdown -r now';done But I want give the users some time before the restart. However they ssh session won’t disconnect even if I use:
ssh -f 'sudo shutdown -r +5 &;disown' I get an error message:
bash: -c: line 0: syntax error near unexpected token
;' bash: -c: line 0:sudo shutdown -r +5 &;disown'
Any suggestions?
&character does send the command on the left hand side in the background. That's how it differs from;.