halthur
March 29th, 2010, 10:16 AM
I am new to Ubuntu and Shell Scripts, but I have set up a shell script to backup files from my workstation (Ubuntu 9.10) to my home server (Ubuntu Server 9.10) using incremental backup with rsync.
The script is run from the server and the backup works perfectly. However, at the end of the script I want to send a command to put the client workstation in suspend or hibernate and I have tested the following commands both in script and directly form the server terminal (I have set up RSA keys to allow login without passwords).
ssh 192.168.0.103 'pm-suspend' This works in the sense that the client workstation goes into suspend, the problem is that the server freezes and seems to wait for the client to respond so it does not get back to the prompt or exits the script until the client workstation has been restarted or I press Ctrl+C.
I have also tested with:
ssh -o ConnectTimeout=20 192.168.0.103 'pm-suspend' but this makes no difference so i guess that I have misunderstood that function.
In other words... I would like help with how I can send a pm-suspend or pm-hibernate command to the client and then go on to finishing the rest of the script and exit.
As a note I can say that it does work with:
ssh 192.168.0.103 'shutdown -P now' But I do not want to turn the client off.
Grateful for help.
The script is run from the server and the backup works perfectly. However, at the end of the script I want to send a command to put the client workstation in suspend or hibernate and I have tested the following commands both in script and directly form the server terminal (I have set up RSA keys to allow login without passwords).
ssh 192.168.0.103 'pm-suspend' This works in the sense that the client workstation goes into suspend, the problem is that the server freezes and seems to wait for the client to respond so it does not get back to the prompt or exits the script until the client workstation has been restarted or I press Ctrl+C.
I have also tested with:
ssh -o ConnectTimeout=20 192.168.0.103 'pm-suspend' but this makes no difference so i guess that I have misunderstood that function.
In other words... I would like help with how I can send a pm-suspend or pm-hibernate command to the client and then go on to finishing the rest of the script and exit.
As a note I can say that it does work with:
ssh 192.168.0.103 'shutdown -P now' But I do not want to turn the client off.
Grateful for help.