2

I know how to suspend after a delay by using:

echo 'pmi action suspend' | at now + 1 minutes

However, that only seems to work as long as I keep the console window open. Am I correct in assuming that the at commands are cleared when I close the console?

This is an issue as I want to be able to log in to my computer via SSH, send the suspend command, then log out before it happens. Suspending immediately tends to freeze my local console window, which is inconvenient. Is there a way to send a delayed suspend command without it being cleared when I log out?

1 Answer 1

1

You can use screen and detach from the screen session. After that you can exit the ssh session and the command will continue to run.

screen (press [Return} to end the help screen)

in the new screen, you type your command and press ctrl-a d to detach from the session

then you can close your ssh terminal.

If you want to reconnect to the screen session, you can type screen -r.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .