To ask for user intervention


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers To ask for user intervention
# 1  
Old 01-31-2014
To ask for user intervention

hi guys
i want my cron to execute for every minute

Last edited by azherkn3; 02-04-2014 at 06:43 AM..
# 2  
Old 01-31-2014
Jobs run by cron are not interactive; they don't have a connection to your keyboard.
This User Gave Thanks to Don Cragun For This Post:
# 3  
Old 01-31-2014
ok is it possible to stop my cron after exectuting for every 20 min for only

Last edited by azherkn3; 02-04-2014 at 06:59 AM..
# 4  
Old 01-31-2014
I would suggest using at instead of cron. Use a file to keep track of how many times the job has run. When the job is ready to exit, it can update the count of how many time it has run, and if it needs to run again, have it use something like:
Code:
at now + 20 minutes <<EOF
command_name arg...
EOF

Of course, instead of using a file to save the count of how many times it has run, the number of times to run the script could be one of the arguments passed to the script.
This User Gave Thanks to Don Cragun For This Post:
# 5  
Old 01-31-2014
how can the same be done in cron ??any suggestion!

how about writing in my script to check the count and just execute my cron

Last edited by azherkn3; 01-31-2014 at 10:55 AM..
# 6  
Old 01-31-2014
You have it a little bit backwards. You don't execute cron; cron executes your script. You don't want to stop cron (which would suspend other cron jobs for you and every other user on your system); you want the script cron runs for you to decide that it should exit rather than do what it designed to do.

Of course you can have your script (which will be executed by cron every 20 minutes [or whatever schedule you set using crontab]) verify that some kind of counter indicates that it should continue processing. If it should continue; it can update the counter and do whatever you want it to do. If it should not continue, it can just exit.

There will still be no way for your script to interactively ask whether or not it should continue after the desired count has been reached.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to write a shell script to automatically accept return key with out user intervention?

Hi Friends, i am creating a shell script which is accepting file name as input parameter from Java and invoking finacle service. The service will accpet text file,B2k_session id,etc and upload the text file data in finacle database. My shell script looks like this:- #! /bin/ksh... (2 Replies)
Discussion started by: vadlamudy
2 Replies

2. Shell Programming and Scripting

giving input without manual intervention

Hi all, I am looking for a specific requirement. I am trying to create a wrapper over a set of shell scripts. Some shell scripts wait for user inputs. These inputs may not be same format. And will be spread across multiple files. In short a set of scripts are going to be run on another set... (1 Reply)
Discussion started by: krk1729
1 Replies

3. Solaris

user intervention when boot different disk

Hello All, I got a question, but I can't find where to set it up. I need your help. The systems are with solaris 10 and with two boot devices (disk 0 and disk1). When the operator wants to boot the different disk then the previous one, i want to get the user intervention to ask operator if... (3 Replies)
Discussion started by: shuhuichen
3 Replies

4. UNIX for Advanced & Expert Users

Determining if user is local-user in /etc/passwd or LDAP user

Besides doing some shell-script which loops through /etc/passwd, I was wondering if there was some command that would tell me, like an enhanced version of getent. The Operating system is Solaris 10 (recent-ish revision) using Sun DS for LDAP. (5 Replies)
Discussion started by: ckmehta
5 Replies

5. Shell Programming and Scripting

root user command in shell script execute as normal user

Hi All I have written one shell script for GPRS route add is given below named GPRSRouteSet.sh URL="www.google.com" VBURL="10.5.2.211" echo "Setting route for $URL for GPRS" URL_Address=`nslookup $URL|grep Address:|grep -v "#"|awk -F " " '{print $2}'|head -1` echo "Executing ... (3 Replies)
Discussion started by: mnmonu
3 Replies

6. Shell Programming and Scripting

Script to login to attached SUN Storage through Solaris m/c w/o user intervention

I want to create a shell script to CLI login to attached SUN 6140 storage from Sun Solaris 9 m/c (instead of using CAM ) but that prompts me for password despite the fact that i am adding them in script .. i am using "expect" feature for this .. however as i never used "expect " before .. so... (0 Replies)
Discussion started by: yogesh29sharma
0 Replies

7. Shell Programming and Scripting

How to use ssh command in the shell script without user intervention?

Hello All, I need your help, i would like to know how to use ssh command in the shell scripts? and make the script continue to enter the password without user intervention example of the normal commands written manually: # ssh 172.30.1.256 -l mxread password: mxread Thanks in advance (3 Replies)
Discussion started by: Dendany83
3 Replies

8. UNIX for Dummies Questions & Answers

Difference between : Locked User Account & Disabled User Accounts in Linux ?

Thanks AVKlinux (3 Replies)
Discussion started by: avklinux
3 Replies

9. Shell Programming and Scripting

How do i change to super user then revert back to ordinary user ,using shell script?

Hi all, I am trying to eject the cdrom from a livecd after certain stage... Now assuming that it is possible to eject,please consider my issue!!! The OS boots into a regular user by default...so i am unable to use the eject command to push out the drive... However if i try pfexec eject it... (3 Replies)
Discussion started by: wrapster
3 Replies

10. UNIX for Dummies Questions & Answers

hit 'enter' with no user intervention

I'd like to write a shell script that will enter '1', for example. How do you do that? You know, so instead of writing echo "Enter 1 or 2" read onetwo and waiting for the user to enter a 1 or 2, I'd like the script to act like someone entered a 1, or 2. Is there a hex value for the... (1 Reply)
Discussion started by: jpprial
1 Replies
Login or Register to Ask a Question