Hi, I'm wondering if it's possible to pause a process I'm running in the background, close my laptop (I need to leave the office), and continue the process (when I get home).
I've been running a process for a really long time and I don't want to have to start it over.
Is that the exact syntax for it? Also, is it possible to just pause the process and then continue it? I'm not sure I have enough battery life for the process to continue running unplugged.
If it is interctive, the susp key as shown on stty -a, usually ctrl-Z, takes the job to stoppped. I have not LINUX laptop experience, but I suppose it can sleep or hibernate until you go home and plug it back in, typing fg to get it running again or bg to resume it in the background.
If you launch it with "nohup . . . &", you can log out, but you still need to keep the machine running, and commutes and batteries vary. You can stop that pid with an appropriate kill command option (SIGSTOP?) but I am not sure how you would start it again . . . .
You need a laptop/O/S that does not reboot when you open the lid, just de-hibernates or un-sleeps. My laptops are co owned or too close to diskless to add an Ubuntu boot to see what the power saving support is. Hibernate is a complete copy of RAM to disk so no power is consumed, but the boot has to reinstate the old images and restart job dispatching. Sleep is a low power state where little or no i/o takes place, but RAM is intact under power and the restart is really fast.
Commands 'jobs', 'bg', 'fg' are only good on the parent, launching, interactive ksh/bash (sh?) shell. Batch need not apply. You cannot, to my knowledge, adopt processes of other terminals or none.
Yes.. For that only you have to use nohup command.. Just use nohup followed by filename. The process will be paused in the process table while the system is off.