Cron job and tty


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Cron job and tty
# 1  
Old 05-22-2012
Cron job and tty

Hi,

I have a document oriented database. IF there are multiple instances of the same running, i kill all those and then start the server again. i check for multiple instances within a specific time intervel. i.e. i make use of crontab.

now the server is getting restarted after the cronjob works. But problem is that the UI is still down. i.e. not accessible.

how do i modify a cronjob such that the tty is set so that the UI is UP.
# 2  
Old 05-22-2012
What do you mean by 'tty is set'?
# 3  
Old 05-22-2012
i did ps uxww and analysed the result.

i checked it after runnin the cronjob.
i also checked it running the restart script manually.

the diff: between the result was that tty field was set for second case. say value of tty was pts/2. while the tty value for the first case was ?

i came to knw that the cronjob does not hv connection to terminal.
# 4  
Old 05-22-2012
The value of the tty comes from the userid that has logged into the database user interface. It is assigned by the OS when they log in. This isn't something that is being set by the startup. If there is a separate process that presents a web front end, then I would check to ensure you are using the right startup script to restart your database and associated processes instead of just trying to restart it manually.
# 5  
Old 05-22-2012
Thanks dagmier for the reply. But my doubt is that, when i restart the server manually the tty is automatically set. but y is it not getting set when i restart the server using same command but with help of crontab. ??

Last edited by sarath@123; 05-22-2012 at 03:21 PM..
# 6  
Old 05-22-2012
The process just inherits the TTY of whatever's running it. When you run it manually, it inherits the TTY (terminal) you ran the command in.

cron doesn't even have a TTY. So, no TTY is inherited.

Do you actually need a TTY?

Last edited by Corona688; 05-22-2012 at 06:30 PM..
# 7  
Old 05-23-2012
Thanks Corona688 for your reply.

Whenever the process is restarted manually, the UI of the document oriented db server is accessible. When the same is done using cronjob the UI of the document oriented db server is not accessible.

what could be the possible reason? any idea?

Last edited by sarath@123; 05-23-2012 at 01:26 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Python: Redirecting to tty and reading from tty

In bash, you can do something like this: #!/bin/bash echo -n "What is your name? " > /dev/tty read thename < /dev/tty How can I do the same in python? I have a python script that has the following content: #!/usr/bin/python2.7 import getpass import sys import telnetlib import... (2 Replies)
Discussion started by: SkySmart
2 Replies

2. Shell Programming and Scripting

Cron job - Need to run Cron every quarter at particular time

Hi, 1) If some job supposed to run on 1st of every month at 7 AM In cron job when we have a blackout on the 1st ( i.e when 1st falls on a sunday ) how can we make the job run the next business day? 2) How can we run a job on 25th of every quarter 7 AM(jan,apr,jul,oct) And if 25th... (5 Replies)
Discussion started by: System Admin 77
5 Replies

3. Shell Programming and Scripting

Commented cron job -- cron monitoring

Hi I have a requirement to write a shell script,that will check the all commented job in cron job.Please help !! (2 Replies)
Discussion started by: netdbaind
2 Replies

4. Solaris

Cron job running even after cron is removed

Hi , I have removed a cron for particular user , but cron job seems to be running even after the cron entry is removed. The purpose of the cron was to sendmail to user ( it uses mailx utility ) I have restarted cron and sendmail service still user is getting mail alerts from the cron job. And... (4 Replies)
Discussion started by: chidori
4 Replies

5. AIX

Help with cron job

Hi guys and gals, I have this script that run perfectly when executed manually. If I place it in a cron to run on a schedule, it fails. Error is: exec(): 0509-036 Cannot load program /usr/local/bin/getlogical because of the following errors: 0509-150 Dependent module... (7 Replies)
Discussion started by: bbbngowc
7 Replies

6. UNIX for Dummies Questions & Answers

cron job

Hi, How to monitor whether a cron job is running or errored out..?other than checking the process using ps-aef how to enter the cron job which throws the output in 1 file and errors in other file. i remember it can be done using >1 and >2 ..but not sure.. any expert..please help!! (1 Reply)
Discussion started by: rujus
1 Replies

7. Solaris

cron job starts new cron proccess

I run cron in solaris 10 zone. One cron job which syncing files to nfs mounted on container, creates after finishing another cron proccess(/usr/sbin/cron), and after 100 existing cron proccesses next cron job will not start. It's too weird for me, I'm not able to solve this problem. Theoretically... (3 Replies)
Discussion started by: ron76
3 Replies

8. UNIX for Dummies Questions & Answers

CRON usage for CRON job

can anybody explain the usage of CRON for adding a cron job. please provide an example also for better understanding !!! Thanks (1 Reply)
Discussion started by: skyineyes
1 Replies

9. Shell Programming and Scripting

cron job

I believe that crob invokes command under bash. But most of our work are carried out using c shell. So what do I need to be aware of (or what precautions should I be taking) when I use cron. (1 Reply)
Discussion started by: sharanbr
1 Replies

10. Shell Programming and Scripting

cron job

Hi Gurus I need to add a new cronjob to a list. There are already 7-8 cronjobs when I do crontab -e. I need to add a new cronjob without disturbing the existing ones. Can you please tell me how to do that. I am not so good in vi editor as well, but I can do it with some guidance. this is urgent,... (3 Replies)
Discussion started by: ragha81
3 Replies
Login or Register to Ask a Question