Rikard, On Saturday 04 November 2006 04:31, Rikard Johnels wrote:
Hello all. Is ther a way to suspend a task from cli? Lets say i have started a databaseupdate or resource demanding cron job on server SRV_1 Can i log on to it via SSH from workstation WS_1 and somehow suspend it temporarily? And then restart it again. I do NOT want to kill it completely but simply send a ^Z to it
Here's how I do it: % alias stop='kill -STOP' % alias start='kill -CONT' If this is a frequent use, put these definitions (without the percent signs, which here just signify their being invoked at an interactive shell prompt). You can use these commands by supplying process or job IDs as arguments when you invoke them. Job IDs are only usable if the task in question was started by the same shell as you use to stop or start it. By the way, you're not sending "^Z" (an ASCII code generated via the tty driver from an attached keyboard) to the target process, but rather the signals SIGSTOP and SIGCONT. And there is a finer point, which is that the terminal driver generates a variant stop signal called SIGTSTP (terminal stop). You might want to look into the command "pidof" to make use of these more convenient, but be careful if there are multiple instances of the program being targeted. Randall Schulz