Cronjob to be execute today at 9pm


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Cronjob to be execute today at 9pm
# 1  
Old 04-24-2013
Cronjob to be execute today at 9pm

HI Folks,
Sorry for this basic confusion but please help me.

i want to execute one script at 9pm today. i want make this as schedule so it can execute automatically.

So am doing like this.

21 10 24 4 <here what can i keep) /tmp/stemp/testcron.ksh

Can you please help on this?

Thank you.
# 2  
Old 04-24-2013
Run /tmp/stemp/testcron.ksh once today 21:00?
Schedule it like this:
Code:
at -k 21:00 < /tmp/stemp/testcron.ksh

Read the man page
Code:
man at


Last edited by MadeInGermany; 04-24-2013 at 07:12 PM.. Reason: man page!
# 3  
Old 04-24-2013
Crontab Builder might help you with creating entries in a crontab file.
# 4  
Old 04-24-2013
Sir am getting errors , can you please check,thank you

Code:
[off_dev@unixscript stemp]$ at -f /tmp/stemp/testcron.ksh now + 1
syntax error. Last token seen: 1
Garbled time
[off_dev@unixscript stemp]$ man at
[off_dev@unixscript stemp]$ at -k 18:30 < /tmp/stemp/testcron.ksh
at: invalid option -- k
Usage: at [-V] [-q x] [-f file] [-m] time
       at [-V] [-q x] [-f file] [-m] -t [[CC]YY]MMDDhhmm
       at -c job [job...]
       (atq | at -l) [-V] [-q x]
       (atrm | at -d | at -r) [-V] [-q x] job ...
       batch [-V] [-f file] [-m]


Last edited by Franklin52; 04-25-2013 at 03:03 AM.. Reason: Please use code tags
# 5  
Old 04-24-2013
Code:
echo "ksh /tmp/stemp/testcron.ksh" | at 21:00

# 6  
Old 04-25-2013
if you want to execute the job by 9 pm tonight then, schdule it like this:
Code:
00 21 25 04 * /tmp/stemp/testcron.ksh

hope this will help you!!!

Last edited by Franklin52; 04-25-2013 at 05:15 AM.. Reason: Code tags
# 7  
Old 04-25-2013
What are cron and crontab, and how do I use them? - Knowledge Base
Looks you need to understand syntex ,read this page will solve your problem
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Execute Ubuntu 14.04 cronjob as non-root

I have created a cronjob that successfully executes and among other thing runs aria2c to download several files and save them to a folder. However, since it executes as sudo, the downloaded folder is saved with those permissions. Is there a way to execute the cronjob so that the downloaded folder... (4 Replies)
Discussion started by: cmccabe
4 Replies

2. Shell Programming and Scripting

Unable to execute glance from cronjob

Hi I am writing a script to get the CPU and memory utilization periodically from glance command. Wrote a script which consists of below two lines Script name : Utilization.sh #!/bin/sh glance -iterations 1 | sed -n '/Util/p/'| awk '!/Disk/'| awk '!/Swap/' >> file.txt I am able to run the... (5 Replies)
Discussion started by: Shravani
5 Replies

3. Shell Programming and Scripting

meaning of today=${1:-${today}}

what does today=${1:-${today}} mean??? I saw a script which has these two lines: today=`date '+%y%m%d'` today=${1:-${today}} but both gives the same value for $today user:/export/home/user>today=`date '+%y%m%d'` user:/export/home/user>echo $today 120326... (2 Replies)
Discussion started by: Vidhyaprakash
2 Replies

4. Shell Programming and Scripting

expect telnet script execute by cronjob

hi, please help, keep getting this bolded error and look it up and people say its your environment variable though i tried to set it manually in expect..it run fine if i run it manually but once i run it by cronjob it error below..i tried to comment out ip/login info with *.. logfile:: START... (0 Replies)
Discussion started by: cssanangeles
0 Replies

5. Shell Programming and Scripting

Execute Shell Script from CRONJOB

Hi Users, I am Newbie to linux and cron. I have a requirement to run a job at 8 AM every Sunday. I am using RHEL 5. Based on the hints through google search I created crontab and added entry to call the shell script which will in turn login to Oracle user and execute a pl/sql block. ... (1 Reply)
Discussion started by: reachravi70
1 Replies

6. Shell Programming and Scripting

How to execute cronjob running in a different machine?

Hi, I am developing 1 script in which I need to execute one cron job running in different server and my script is in different server. so can any one help me to execute the cronjob set in different server. Thanks in advance. (1 Reply)
Discussion started by: mridul10_crj
1 Replies

7. UNIX for Dummies Questions & Answers

how to cancel a cronjob if the cronjob still running

hi everyone I'm newbie in this forum hope I can get some help here :) I have a command in crontab that executed every 1 minute sometime this command need more than 1 minute to finish the problem is, the crontab execute this command although it's not finish processing yet and causing the system... (7 Replies)
Discussion started by: 2j4h
7 Replies

8. Shell Programming and Scripting

Check a condition in cronjob to execute a sh file

Hi, I need to execute a crontab based on a condition where one SH file should be executed only based on the output of a file in a folder. I have written the following cron job which is not working. 00 01 * * * read a < /px/batch/reslut.txt && && sh /px/batch/check.sh where my... (2 Replies)
Discussion started by: shanth_chandra
2 Replies

9. Shell Programming and Scripting

need to have a cronjob which will execute certain scripts every hr

Hi My question needs two answers how to write scripts to update a table in oracle db based on the result of the number of record counts for example i need to execute the following script every hour awk '{sum++;}END{for(i in sum) {print i, sum}}' filename here everyhour the... (3 Replies)
Discussion started by: aemunathan
3 Replies

10. Shell Programming and Scripting

Need to execute 2 scripts, wait, execute 2 more wait, till end of file

:cool: I need to execute a shell script to do the following: cat a file run two back ground processes using the first two values from the file wait till those background processes finish run two more background processes using the next two values from the file wait till those background... (1 Reply)
Discussion started by: halo98
1 Replies
Login or Register to Ask a Question