The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
background jobs exit status and limit the number of jobs to run GrepMe Shell Programming and Scripting 1 06-11-2007 07:56 PM
How to write a Script to run series of batch jobs on unix platform venki311 Shell Programming and Scripting 2 07-30-2006 03:26 PM
Overlapping(executing time) jobs in crontab new2ss Shell Programming and Scripting 3 02-17-2006 02:29 AM
time take by a script encrypted Shell Programming and Scripting 3 07-14-2004 04:54 PM
Script to make a new workspace and start jobs laho Shell Programming and Scripting 0 03-09-2004 02:13 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-25-2008
Modki Modki is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 3
Help with script that submits jobs at a certain time.

Here's the line I type everyday.


Code:
echo  "submit daily 00559 00010 00011" | at 21:00

I dunno. I'm totally new to this. Basically I want this to be fool-proof for everyone else we've had people do things like:

subit daily 00559 00010 00011
submit daly 00559 00010 00011
Submit daily (no params)
submit daily 00559 00010 0001111

So I'm tired of seeing it messed up.. The company doesn't want it added to cron (don't ask long story)
  #2 (permalink)  
Old 04-25-2008
era era is offline Forum Advisor  
Herder of Useless Cats (On Sabbatical)
  
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,652
Submitting an at job from the previous job is a time-honored method, even if in this case it sounds like you would be bending the rules a little bit.


Code:
#!/bin/sh

submit daily 00559 00010 00011
sleep 300 # just in case
echo "$0" | at 21:00

You'd run this at 21:00 once, and then it should take care of itself (until management notices ...)

$0 is the name of the currently running script, and echoing it to "at" will schedule it to run again at 21:00, tomorrow if submitted after 21:00 (at least in my version of at).
  #3 (permalink)  
Old 04-25-2008
Modki Modki is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 3
Quote:
Originally Posted by era View Post

Code:
#!/bin/sh

submit daily 00559 00010 00011
sleep 300 # just in case
echo "$0" | at 21:00

You'd run this at 21:00 once, and then it should take care of itself (until management notices ...)
Yes, so could I do


Code:
#!/bin/sh
echo "submit daily 00559 00010 00011" | at 21:00
echo "Daily Submitted. Please verify the atlist for correct times/parameters"
atlist

This is for the other people that are sometimes on-call. I would like them to be able to just type "subdaily.sh" and it adds it to at without any room to make errors.

I'm pretty "good" with batch files so that's why there may be some errors in that... But I'm new to HP-UX and this system. The previous guy left one day and I've been trying to pick it up as best as I can.
  #4 (permalink)  
Old 04-25-2008
era era is offline Forum Advisor  
Herder of Useless Cats (On Sabbatical)
  
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,652
Well yes, if you still want it submitted by hand then that's a good solution.
  #5 (permalink)  
Old 04-25-2008
Modki Modki is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 3
Quote:
Originally Posted by era View Post
Well yes, if you still want it submitted by hand then that's a good solution.
Yes I don't want to automate it. Apparently that's a gigantic no-no with this system (I was all for cron since the params never change), but oh well thank you very much. Is there such a thing as +Rep on this board? I can't find it. But many + Rep on to you nonetheless.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:53 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0