Sponsored Content
Top Forums Shell Programming and Scripting Cronjob not working as intended Post 302898250 by sumitsks on Monday 21st of April 2014 01:35:06 AM
Old 04-21-2014
I think you have to provide the code for both scripts here.. so that we can know what cmds you are trying to execute
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

sftp not working as cronjob

hi, I have a script that will automatically login into a server and get a file. it is working fine if i run it on a command line. however, when i tried to run it as a cron job, it is not working. what should i do? set timeout -1 spawn /usr/bin/sftp user1@server1 match_max 100000 expect... (3 Replies)
Discussion started by: tungaw2004
3 Replies

2. UNIX for Advanced & Expert Users

cronjob not working

I created a file in /u01/oradata directory as cronjb.ksh which contains following script 30 12 * * * /export/home/oracle/u01/oradata/rman.ksh '/export/home/oracle' is my root directory. I then moved cronjb.ksh file to my '/export/home/oracle' directory. i typed crontab cronjb.ksh. However my... (8 Replies)
Discussion started by: manna
8 Replies

3. Shell Programming and Scripting

script not working as intended for password

Hi I have a script which uses expect and I run it on solaris 10 to set a common password for all users. I run it as `./script password` but when I tried to log into the system then I do not really have to type password, pressing ENTER on keyboard logs the user into system. (ssh) This below... (2 Replies)
Discussion started by: upengan78
2 Replies

4. Solaris

cronjob not working

I am trying to schedule a job via cronjob. Not sure what the problem is. below is my script and the error. 45 10 * * * /u01/app/oracle/jpark/sched_exp_mis.sh Error received. Your "cron" job on tama /u01/app/oracle/jpark/sched_exp_mis.sh produced the following output: ... (19 Replies)
Discussion started by: mrx1350
19 Replies

5. Solaris

cronjob not working

Hi All , I have a cron jobs that is not working while put inside cron. But on executing from manually, it works fine, Pl anyone find if there is anything wrong in the script. 30 22 * * 1-5 cd /home/ab90737/introscope/util/bin; ./batchgenerateReport.pl ../config/reps.config >... (1 Reply)
Discussion started by: jegaraman
1 Replies

6. UNIX for Advanced & Expert Users

cronjob not working intermittently

Hi there I have a cronjob running on a sol 10 U6 server which runs every 15 minutes. The cronjob is a perl script. But I have noticed that after every few weeks the job stops running all of a sudden. There are other cronjobs running on the system from the same user and from other users which... (3 Replies)
Discussion started by: sinfuldips
3 Replies

7. Shell Programming and Scripting

while loop not working in cronjob

Hi , While loop is not working when running script as cronjob. #!/usr/bin/bash xyz sleep 30 var=0 while do xyz commands done This script is working if I run it manually. (7 Replies)
Discussion started by: ankush_mehra
7 Replies

8. UNIX for Dummies Questions & Answers

Cronjob not working

Hi, I am trying to run a script through crontab but it doesn't run. The script sends an email of the logfile created.When I reun through command line it works perfectly but doesn't send any email through cron. There are othe jobs in cron wich runs perfectly. Please let me know if I am doing... (3 Replies)
Discussion started by: Rossdba
3 Replies

9. Shell Programming and Scripting

Cronjob is NOT working

Hi; Here is the output from crontab -l: 2,7,12,17,22,27,32,37,42,47,52,57 * * * * /var/tmp/gcsw/jmap_samples/jmap_script.sh > /var/tmp/gcsw/jmap_samples/histo_`date '+%Y%m%d%H%M'`.txtWhen I manually run the line: /var/tmp/gcsw/jmap_samples/jmap_script.sh >... (2 Replies)
Discussion started by: gc_sw
2 Replies

10. Shell Programming and Scripting

PHP cronjob not working but manual working

Hi, Can anyone help me on my PHP cron not working, but when i do the manual it work. # manual run working /usr/local/bin/php /root/dev/test.php # crontab not working 55 8 * * * /usr/local/bin/php /root/dev/test.php Thank in advances Regards, FSPalero Please use CODE tags as... (2 Replies)
Discussion started by: fspalero
2 Replies
semctl(2)							System Calls Manual							 semctl(2)

Name
       semctl - semaphore control operations

Syntax
       #include <sys/types.h>
       #include <sys/ipc.h>
       #include <sys/sem.h>

       int semctl (semid, semnum, cmd, arg)
       int semid, cmd;
       int semnum;
       union semun {
	    int val;
	    struct semid_ds *buf;
	    ushort array[];
       } arg;

Description
       The  system  call  provides a variety of semaphore control operations as specified by cmd.  The following cmds are executed with respect to
       the semaphore specified by semid and semnum:

       GETVAL	      Return the value of semval.  For further information, see

       SETVAL	      Set the value of semval to arg.val.  When this command is successfully executed, the semadj value corresponding to the spec-
		      ified semaphore in all processes is cleared.

       GETPID	      Return the value of sempid.

       GETNCNT	      Return the value of semncnt.

       GETZCNT	      Return the value of semzcnt.

       The following cmds return and set every semval in the set of semaphores:

       GETALL	      Place semvals into array pointed to by arg.array.

       SETALL	      Set  semvals  according  to  the array pointed to by arg.array When this command is successfully executed, the semadj values
		      corresponding to each specified semaphore in all processes are cleared.

       The following cmds are also available:

       IPC_STAT       Place the current value of each member of the data structure associated  with  semid  into  the	structure  pointed  to	by
		      arg.buf.	The contents of this structure are defined in

       IPC_SET	      Set  the	value of the following members of the data structure associated with semid to the corresponding value found in the
		      structure pointed to by arg.buf:
		      sem_perm.uid
		      sem_perm.gid
		      sem_perm.mode /* only low 9 bits */

       This command can only be executed by a process that has an effective user ID equal to  superuser  or  to  the  values  of  sem_perm.uid	or
       sem_perm.cuid in the data structure associated with semid.

       IPC_RMID       Remove  the  semaphore  identifier  specified  by semid from the system and destroy the set of semaphores and data structure
		      associated with it.  This cmd can only be executed by a process that has an effective user ID equal to either that of  supe-
		      ruser or to the value of sem_perm.uid in the data structure associated with semid.

Return Values
       Upon successful completion, the value returned depends on cmd, as follows:

       GETVAL	      The value of semval.

       GETPID	      The value of sempid.

       GETNCNT	      The value of semncnt.

       GETZCNT	      The value of semzcnt.

       All other      A value of 0.

       Otherwise, a value of -1 is returned and errno is set to indicate the error.

Diagnostics
       The system call fails if any of the following is true:

       [EINVAL]       The semid is not a valid semaphore identifier.

       [EINVAL]       The semnum is less than zero or greater than sem_nsems.

       [EINVAL]       The cmd is not a valid command.

       [EACCES]       Operation permission is denied to the calling process.  For further information, see

       [ERANGE]       The cmd is SETVAL or SETALL, and the value to which semval is to be set is greater than the system imposed maximum.

       [EPERM]	      The  cmd	is equal to IPC_RMID or IPC_SET and the effective user ID of the calling process is not equal to that of superuser
		      nor to the value of sem_perm.uid in the data structure associated with semid.

       [EFAULT]       The arg.buf points to an illegal address.

See Also
       errno(2), intro(2), semget(2), semop(2)

																	 semctl(2)
All times are GMT -4. The time now is 12:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy