Sponsored Content
Top Forums Shell Programming and Scripting Expect Script not running from cron. Full Paths used Post 302871491 by vbe on Wednesday 6th of November 2013 09:55:34 AM
Old 11-06-2013
If you solved the problem, it would be nice NOT to ask to close the thread but to explain what was the issue and the remedy applied...
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

expect script in cron

I wrote a script using 'expect' tool to change the password of my login id, every fortnight. And I had put it as a cron job. The cron job is throwing an error ld.so.1: /usr/local/bin/expect: fatal: libtcl8.3.so: open failed: No such file or directory The environment variables are set... (4 Replies)
Discussion started by: Deepa
4 Replies

2. UNIX for Dummies Questions & Answers

expect and stty paths are different and resulting in error.

Hello, i am using expect to automate file transfers to and fro with a sftp server. below is the script i am creating and executing in the main program. but i am getting the following error: the main program that creates and runs this script looks for words like "not found" in... (6 Replies)
Discussion started by: The Nemi
6 Replies

3. Shell Programming and Scripting

calling expect script in ksh is failing via cron

I'm calling an expect script via a ksh script in cron and it is failing. The script runs fine if i run it manually. Does anyone know if it is an issue with compatibilty and if there is a way around it? (2 Replies)
Discussion started by: bhatia
2 Replies

4. Shell Programming and Scripting

How to write an expect script to check if a process is running?

I'm new to expecting and i want to create a script to ssh to a device,check is a process is running and display that the process is running or not.This is what i have so far After executing this script i get an error. #!/usr/bin/expect set timeout -1 set ip "machine ip goes here" set... (5 Replies)
Discussion started by: icchi
5 Replies

5. Shell Programming and Scripting

Using expect script with AIX's SMIT in cron

My searches turned up nothing relevant, so I apologize if this has already been looked at. I am trying to run an expect script from a Solaris machine, that ssh's into an AIX machine, and interacts with a SMIT created menu system that runs a few backups for me. The expect script runs fine when... (0 Replies)
Discussion started by: Mariognarly
0 Replies

6. Shell Programming and Scripting

how to debug an expect script running on a tomcat server

Hello everyone, I have a small expect script as follows; #!/usr/bin/expect -f set force_conservative 0 ;# set to 1 to force conservative mode even if ;# script wasn't run conservatively originally if {$force_conservative} { set send_slow {1 .1} proc send {ignore arg}... (1 Reply)
Discussion started by: randeel
1 Replies

7. Shell Programming and Scripting

Expect script cronjob running but dying prematurely

I have an Ubuntu machine that I'd like to update automatically. I've written an expect script to run the aptitude package manager and update my packages. Essentially it does: aptitude update && aptitude upgrade while answering "yes" at the appropriate time. It works quite nicely when run... (4 Replies)
Discussion started by: CluelessPerson
4 Replies

8. Shell Programming and Scripting

ps command showing full code of running script

Hi, I have a script running while rsync command is fired to push some files. The output of rsync cmd has been redirected to the script which is used to generate log files containing progress info with formatting. when I enter ps -ef | grep rsync it shows the full scripting code on the cmd line... (2 Replies)
Discussion started by: rajeevra
2 Replies

9. Shell Programming and Scripting

expect script not running in cron "Urgent"

I wrote a script to download the files from sftp location to local. while running the script manually its working fine. when i schedule the same in cron its not working.... :wall::wall: here is the script: #!/bin/bash ... (2 Replies)
Discussion started by: ganga39
2 Replies

10. Shell Programming and Scripting

Expect script not executing via cron

Hello All, I'm having an issue getting an expect script to run as a cron job. The script executes fin if I run it from the command line but I get nothing when trying to run it as a cron job. I've researched other forums and threads and there have been references to the environment, or lack... (16 Replies)
Discussion started by: KingT617
16 Replies
getpriority(3C) 					   Standard C Library Functions 					   getpriority(3C)

NAME
getpriority, setpriority - get and set the nice value SYNOPSIS
#include <sys/resource.h> int getpriority(int which, id_t who); int setpriority(int which, id_t who, int value); DESCRIPTION
The getpriority() function obtains the nice value of a process, thread, or set of processes. The setpriority() function sets the nice value of a process, thread, or set of processes to value+NZERO, where NZERO is defined to be 20. Target entities are specified by the values of the which and who arguments. The which argument can be one of the following values: PRIO_PROCESS, PRIO_PGRP, PRIO_USER, PRIO_GROUP, PRIO_SESSION, PRIO_LWP, PRIO_TASK, PRIO_PROJECT, PRIO_ZONE, or PRIO_CONTRACT, indicating that the who argument is to be interpreted as a process ID, a process group ID, an effective user ID, an effective group ID, a session ID, a thread (lwp) ID, a task ID, a project ID, a zone ID, or a process contract ID, respectively. A 0 value for the who argument specifies the current process, process group, or user. A 0 value for the who argument is treated as valid group ID, session ID, thread (lwp) ID, task ID, project ID, zone ID, or process contract ID. A P_MYID value for the who argument can be used to specify the current group, session, thread, task, project, zone, or process contract, respectively. If a specified process is multi-threaded, the nice value set with setpriority() affects all threads in the process. If more than one process is specified, getpriority() returns NZERO less than the lowest nice value pertaining to any of the specified enti- ties, and setpriority() sets the nice values of all of the specified processes to value+NZERO. The default nice value is NZERO. Lower nice values cause more favorable scheduling. The range of valid nice values is 0 to NZERO*2-1. If value+NZERO is less than the system's lowest supported nice value, setpriority() sets the nice value to the lowest supported value. If value+NZERO is greater than the system's highest supported nice value, setpriority() sets the nice value to the highest supported value. Only a process with appropriate privileges can lower the nice value. Any process or thread using SCHED_FIFO or SCHED_RR is unaffected by a call to setpriority(). This is not considered an error. A process or thread that subsequently reverts to SCHED_OTHER will not have its priority affected by such a setpriority() call. The effect of changing the nice value varies depending on the scheduling policy in effect. Since getpriority() can return the value -1 on successful completion, it is necessary to set errno to 0 prior to a call to getpriority(). If getpriority() returns the value -1, then errno can be checked to see if an error occurred or if the value is a legitimate nice value. RETURN VALUES
Upon successful completion, getpriority() returns an integer in the range from -NZERO to NZERO-1. Otherwise, -1 is returned and errno is set to indicate the error. Upon successful completion, setpriority() returns 0. Otherwise, -1 is returned and errno is set to indicate the error. ERRORS
The getpriority() and setpriority() functions will fail if: ESRCH No process or thread could be located using the which and who argument values specified. EINVAL The value of the which argument was not recognized, or the value of the who argument is not a valid process ID, process group ID, user ID, group ID, session ID, thread (lwp) ID, task ID, project ID, or zone ID. In addition, setpriority() may fail if: EPERM A process was located, but neither the real nor effective user ID of the executing process match the effective user ID of the process whose nice value is being changed. EACCES A request was made to change the nice value to a lower numeric value and the current process does not have appropriate privi- leges. EXAMPLES
Example 1 Example using getpriority() The following example returns the current scheduling priority for the process ID returned by the call to getpid(2). #include <sys/resource.h> ... int which = PRIO_PROCESS; id_t pid; int ret; pid = getpid(); ret = getpriority(which, pid); Example 2 Example using setpriority() The following example sets the nice value for the current process to 0. #include <sys/resource.h> ... int which = PRIO_PROCESS; id_t pid; int value = -20; int ret; pid = getpid(); ret = setpriority(which, pid, value); USAGE
The getpriority() and setpriority() functions work with an offset nice value (value-NZERO). The nice value is in the range 0 to 2*NZERO-1, while the return value for getpriority() and the third parameter for setpriority() are in the range -NZERO to NZERO-1. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Committed | +-----------------------------+-----------------------------+ |Standard |See standards(5). | +-----------------------------+-----------------------------+ SEE ALSO
nice(1), renice(1), sched_get_priority_max(3C), sched_setscheduler(3C), attributes(5), standards(5) SunOS 5.11 1 Apr 2008 getpriority(3C)
All times are GMT -4. The time now is 07:49 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy