Sponsored Content
Top Forums UNIX for Dummies Questions & Answers suspend a *background* running job Post 302483368 by uiop44 on Sunday 26th of December 2010 03:31:30 PM
Old 12-26-2010
suspend a *background* running job

Is there a way to suspend (TSTP?) a job that is running in the background, _without_ first bringing it to the foreground and inputting Ctrl-Z from the keyboard?

IOW, something similar to issuing the shell's bg builtin command on a job ID to resume a job that is suspended in the background, except here we want to _suspend_ a job that is already running in the background.

Cheers
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

background job

I try to run a script as background job. script: #!/usr/bin/csh /usr/bin/date +20%y-%m-%d > ~/datsql.txt If I start it I got this output: tac> ./datermitteln& 293 + Stopped (SIGTTOU) ./datermitteln& I insert the following line inside my script, but without any... (3 Replies)
Discussion started by: joerg
3 Replies

2. UNIX for Dummies Questions & Answers

Background job

Hiya, Recently I've run a few scripts in the foreground, but have realised later they should of been better nohup'd and placed in the background. I understand how to change a foreground job into a background one, but how would put the job into the nohup state? Thanks (1 Reply)
Discussion started by: rdbooth
1 Replies

3. UNIX for Dummies Questions & Answers

background job

on gnome i open a terminal and run wget http://soommmething & in the background. because wget shows me downloading progress percentage and download speed continuously, I exit the gnome-terminal after a while i want to see the download percentage but dont know how. my ps -u myname shows that... (3 Replies)
Discussion started by: babayeve
3 Replies

4. Shell Programming and Scripting

Suspend Cron job temprory

Hi Is there any way to suspend cron job without ommitting crontab entries?? I have a no of entries in crontab, which runs daily.......... what if I want to suspend all process in cron one day . Is there any one line command for it ?? Please suggest Rergards Pankaj (4 Replies)
Discussion started by: pankajkrmishra
4 Replies

5. AIX

Question on background running job

Guys, We use AIX 5.3 at our work place. I only in my team have a strange problem of not able run jobs background. Other colleagues are able to run without any problem. Once I kick off background job using nohup and & command, It immediately stops. The following error I get when I run. ... (2 Replies)
Discussion started by: anandsbr
2 Replies

6. Shell Programming and Scripting

Background Job

Hello Everyody, Having a doubt. sort file1 & when we sent a job to the background it returns Job Number PID again if we want to ... (1 Reply)
Discussion started by: knroy10
1 Replies

7. Solaris

Is user cron job running in background?

Hi, Should the user jobs specified in crontab be running in background? Cron daemon is already running in background. So I am not sure whether should the jobs (output and error messages are redirected to file) ran by it be explicitly stated to be run in background (& at end of command) if one... (1 Reply)
Discussion started by: joe_x
1 Replies

8. Shell Programming and Scripting

Execute a function in background and then suspend it

Here is some back ground on the script. The script is to poll an arbitrary number of DB's. To do this I am creating a function that takes the file_path to the DB and the min poll interval as arguments. The function will be called for each DB and then ran in the background. The function I was... (6 Replies)
Discussion started by: ryandavison
6 Replies

9. Shell Programming and Scripting

Get status of dd running in background job

Hello everyone While working on TUI for scripts, there there came the idea to' add a command' for dd too. That was, after 'wrapping' tar and wget either, to display their growing size and return the exit code with a textual-visual-feedback to the user. Now displaying the filesize of a... (13 Replies)
Discussion started by: sea
13 Replies
drmaa_jobcontrol(3)					       Sun Grid Engine DRMAA					       drmaa_jobcontrol(3)

NAME
drmaa_job_ps, drmaa_control, - Monitor and control jobs SYNOPSIS
#include "drmaa.h" int drmaa_job_ps( const char *job_id, int *remote_ps, char *error_diagnosis, size_t error_diag_len ); int drmaa_control( const char *jobid, int action, char *error_diagnosis, size_t error_diag_len ); DESCRIPTION
The drmaa_job_ps() function returns the status of the Sun Grid Engine job job_id into the integer pointed to by remote_ps. Possible return values are DRMAA_PS_UNDETERMINED job status cannot be determined DRMAA_PS_QUEUED_ACTIVE job is queued and active DRMAA_PS_SYSTEM_ON_HOLD job is queued and in system hold DRMAA_PS_USER_ON_HOLD job is queued and in user hold DRMAA_PS_USER_SYSTEM_ON_HOLD job is queued and in user and system hold DRMAA_PS_RUNNING job is running DRMAA_PS_SYSTEM_SUSPENDED job is system suspended DRMAA_PS_USER_SUSPENDED job is user suspended DRMAA_PS_DONE job finished normally DRMAA_PS_FAILED job finished, but failed Jobs' user hold and user suspend states can be controlled via drmaa_control(3). For affecting system hold and system suspend states the appropriate Sun Grid Engine interfaces must be used. drmaa_control() The drmaa_control() function applies control operations on Sun Grid Engine jobs. jobid may contain either an Sun Grid Engine jobid or `DRMAA_JOB_IDS_SESSION_ALL' to refer to all jobs submitted during the DRMAA session opened using drmaa_init(3). Legal values for action and their meanings are: DRMAA_CONTROL_SUSPEND suspend the job DRMAA_CONTROL_RESUME resume the job, DRMAA_CONTROL_HOLD put the job on-hold DRMAA_CONTROL_RELEASE release the hold on the job DRMAA_CONTROL_TERMINATE kill the job The DRMAA suspend/resume operations are equivalent to the use of `-sj <jobid>' and `-usj <jobid>' options with Sun Grid Engine qmod(1). The DRMAA hold/release operations are equivalent to the use of Sun Grid Engine qhold(1) and qrls(1). The DRMAA terminate operation is equivalent to the use of Sun Grid Engine qdel(1). Only user hold and user suspend can be controlled via drmaa_control(3). For affecting system hold and system suspend states the appropriate Sun Grid Engine interfaces must be used. ENVIRONMENTAL VARIABLES
SGE_ROOT Specifies the location of the Sun Grid Engine standard configuration files. SGE_CELL If set, specifies the default Sun Grid Engine cell to be used. To address a Sun Grid Engine cell Sun Grid Engine uses (in the order of precedence): The name of the cell specified in the environment variable SGE_CELL, if it is set. The name of the default cell, i.e. default. SGE_DEBUG_LEVEL If set, specifies that debug information should be written to stderr. In addition the level of detail in which debug infor- mation is generated is defined. SGE_QMASTER_PORT If set, specifies the tcp port on which sge_qmaster(8) is expected to listen for communication requests. Most installations will use a services map entry instead to define that port. RETURN VALUES
Upon successful completion, drmaa_job_ps(), and drmaa_control() return DRMAA_ERRNO_SUCCESS. Other values indicate an error. Up to error_diag_len characters of error related diagnosis information is then provided in the buffer, error_diagnosis. ERRORS
The drmaa_job_ps(), and drmaa_control() will fail if: DRMAA_ERRNO_INTERNAL_ERROR Unexpected or internal DRMAA error, like system call failure, etc. DRMAA_ERRNO_DRM_COMMUNICATION_FAILURE Could not contact DRM system for this request. DRMAA_ERRNO_AUTH_FAILURE The specified request was not processed successfully due to authorization failure. DRMAA_ERRNO_INVALID_ARGUMENT The input value for an argument is invalid. DRMAA_ERRNO_NO_ACTIVE_SESSION Failed because there is no active session. DRMAA_ERRNO_NO_MEMORY Failed allocating memory. DRMAA_ERRNO_INVALID_JOB The specified job does not exist. The drmaa_control() will fail if: DRMAA_ERRNO_RESUME_INCONSISTENT_STATE The job is not suspended. The resume request will not be processed. DRMAA_ERRNO_SUSPEND_INCONSISTENT_STATE The job is not running and thus cannot be suspended. DRMAA_ERRNO_HOLD_INCONSISTENT_STATE The job cannot be moved to a hold state. DRMAA_ERRNO_RELEASE_INCONSISTENT_STATE The job is not in a hold state. SEE ALSO
drmaa_submit(3)and drmaa_wait(3). SGE 6.2u5 $Date$ drmaa_jobcontrol(3)
All times are GMT -4. The time now is 09:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy