Pausing and resuming process on laptop


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Pausing and resuming process on laptop
# 1  
Old 10-19-2012
Pausing and resuming process on laptop

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.

Thanks in advance!
# 2  
Old 10-19-2012
For that you have to use a unix command
Quote:
nohup
.
It will run a job even when the system is hung.
# 3  
Old 10-19-2012
Sorry, I'm really inexperienced.

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.
# 4  
Old 10-19-2012
Code:
nohup filename

If you want run the same process in the background. Simply you can use this..
Code:
nohup filename &

---------- Post updated at 04:20 PM ---------- Previous update was at 04:15 PM ----------

Quote:
Originally Posted by ShiGua
Sorry, I'm really inexperienced.

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.

To stop a process simply you can use Cntrl+z. Then the process will be stopped. In order to restart the process you have to use
Quote:
bg jobid
or
Quote:
fg jobid
fg- to run the process in the foreground
bg- to run the job in the background.
This User Gave Thanks to Adhi For This Post:
# 5  
Old 10-19-2012
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 . . . .
This User Gave Thanks to DGPickett For This Post:
# 6  
Old 10-19-2012
For example You are running a process (or) job,
Code:
sleep 50

Now the process is running in the foreground. If you want to stop the process press Control+z..
Then the process will be stopped.

In order to restart the stopped process use this command
Code:
fg jobId

It will run the process again in the foreground.
similarly
Code:
bg jobId

It will run the process again in the background.

---------- Post updated at 04:30 PM ---------- Previous update was at 04:28 PM ----------

To get the Job Id and Process Id
Code:
jobs -l

or
Code:
ps

# 7  
Old 10-19-2012
Just to make sure, the job will be held when I close my laptop right? I just don't want it to "forget" it and then have to start all over.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Pausing a cron job

Hi All, I have a cronjob which runs a script every 5 mins. My problem is before the script is completed the cron job starts again after 5 mins. How can I put this second cron job to wait unless the first script has completed. Could you please help me on that (7 Replies)
Discussion started by: prats_7678
7 Replies

2. Ubuntu

Laptop to laptop transfer files

Dear all, I would like to transfer my old laptop documents/files etc to the new laptop without using any external hard disk. Please let me know if its possible via any way. Thank in advance, emily (3 Replies)
Discussion started by: emily
3 Replies

3. Shell Programming and Scripting

Read not prompting/ pausing for input

Heya people, So my script is one of those make-user-scripts, making a bunch of directories in the home folder and copying some files over into the new directories. However, part of the thing my script need to do is check the home folder if a username matches with a directory which already exists.... (6 Replies)
Discussion started by: Cloudy_Cat
6 Replies

4. Linux

TuxOnIce stalls 3 times before resuming

I am having trouble resuming from hibernation using TuxOnIce method. The thing works, but in a very strange manner. Here's how it looks: 1. Computer boots and finds resume image and starts resume. It reads image from disk (takes ~10 seconds) Reading kernel & process data... Atomic restore.... (8 Replies)
Discussion started by: lockheed
8 Replies

5. Ubuntu

Connect 2 laptops with RJ45 cable (Ubuntu 10.10 laptop with Windows 7 laptop)

Hi to all, I have the problem that a laptops with windows XP cannot startup even in safe mode nor using last good known configuration. I have a Ubuntu 10.10 Live CD and booting from it I can read the Hard Drive. I need to do a backup the Hard Drive from XP laptop and I want to connect this... (5 Replies)
Discussion started by: cgkmal
5 Replies

6. Shell Programming and Scripting

Pausing function with Perl

Hi all, I got the request to make a Perl script with the requirements as follow: 1. Make a program that just shows the time, a clock on the format 12:01:24. 2. When someone press key combination Ctrl -p the program should pause, ie the clock will stand still. When the Ctrl - p is pressed... (3 Replies)
Discussion started by: milo
3 Replies

7. Solaris

solaris 10 not resuming from power save mode.

Dear Frnz, i have a ultra 45 with solaris 10 installed. I face a weird issue in that. once the machine goes to power save mode i am not able to bring the machine back by hitting the keys in keyboard or moving the mouse. I am able to rsh the machine from another machine. To bring the... (1 Reply)
Discussion started by: sriram.s
1 Replies

8. Solaris

System not resuming from stanby mode ---Solaris10

Dear Frnds, I have a weird issue with solaris 10. We bought a new Sun Ultra45 workstation and i installed solaris 10 in that. The problem is when it goes to standby mode i am not able to resume the system.The only thing i can do is to manually reboot and start working. The problem occurs... (0 Replies)
Discussion started by: sriram.s
0 Replies

9. Shell Programming and Scripting

Pausing a Grep output

I am writing a small script which allows users to grep multiple log files across multiple directories, and often the output produced by the grep statements is quite lengthy. It would be nice if the output to the screen could be "paused" when it reaches a certain length (say, the length of the... (5 Replies)
Discussion started by: mharley
5 Replies

10. Shell Programming and Scripting

pausing a script

hello all, I have a script (Solaris v8 ksh) monitoring an inbound directory for reports. The script will then capture the report based on a set of circumstances. However I am unable to capture a report larger then 2-Gig in size due to program limitations. What I need to do is pause the monitor... (6 Replies)
Discussion started by: gozer13
6 Replies
Login or Register to Ask a Question