Visit Our UNIX and Linux User Community


Crontab


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Crontab
# 1  
Old 10-06-2009
Crontab

Hello!

I wanna execute an awk program every hour, the time is not important, i've created with
Code:
crontab -e

Code:
* * * * * /route/program

but it doesn't works

anybody can help me?

Thanks!
# 2  
Old 10-06-2009
Hello,

Per our forum rules, all threads must have a descriptive subject text. For example, do not post questions with subjects like "Help Me!", "Urgent!!" or "Doubt". Post subjects like "Execution Problems with Cron" or "Help with Backup Shell Script".

The reason for this is that nearly 95% of all visitors to this site come here because they are referred by a search engine. In order for future searches on your post (with answers) to work well, the subject field must be something useful and related to the problem!

In addition, current forum users who are kind enough to answer questions should be able to understand the essence of your query at first glance.

So, as a benefit and courtesy to current and future knowledge seekers, please be careful with your subject text. You might receive a forum infraction if you don't pay attention to this.

Thank you.

The UNIX and Linux Forums

---------- Post updated at 11:08 ---------- Previous update was at 11:04 ----------

The line you gave will run the script every minute of every hour of every day. Give it some random value (0 <= x <= 59) in the minute field to have it run only once per hour.

If it still doesn't work, check the execute permissions on your script, and your email. Any output by cron will be sent to your user.
# 3  
Old 10-06-2009
/home/jcontreras/Desktop/echo: line 1: file2.conf: No such file or directory

This is the message that it returns in my user's mail, but if i do it like a root it doesn't returns anything in the mail, but still not working

In the script that i wanna execute i have to lines, the first touch a file writing in some words, and the second line executes an awk program, but the awk program not works, but if i execute this awk program in the command line it works fine.
# 4  
Old 10-06-2009
Hi,

Please can you just check if awk is installed on your Unix box.

Cheers,
Shazin
# 5  
Old 10-06-2009
Quote:
Originally Posted by claw82
/home/jcontreras/Desktop/echo: line 1: file2.conf: No such file or directory
This means that there's something wrong with your script, not the crontab entry. Have you tried running the script itself, instead of each command by it's own? You can get a trace of what is done by putting the line
Code:
set -x

near the beginning of your script.

Besides that, 'echo' is not really the best name for a script, as it's both an executable and a built-in command in most shells. Try to avoid such reserved names, as it can create confusion.
# 6  
Old 10-06-2009
if i execute my awk it works fine
Code:
awk -f lee_conf.awk<file2.conf

but when i do that in my "prog" script, after "echo"
Code:
#!/bin/sh
echo "prueba">>/home/jcontreras/Desktop/prueba.txt

awk -f /home/jcontreras/Desktop/lee_conf.awk</home/jcontreras/Desktop/file2.conf

"prog" is the script that the crontab executes, then it doesn't works
# 7  
Old 10-06-2009
And what happens if you change "file2.conf" to "prueba.txt" in the awk command?
 

Previous Thread | Next Thread
Test Your Knowledge in Computers #629
Difficulty: Easy
In PHP, False == 0;
True or False?

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

at vs crontab

Hi, can someone explain the differences between using the at and crontab commands. When would you use one command over the other? TIA Dom (1 Reply)
Discussion started by: domburf69
1 Replies

2. Shell Programming and Scripting

crontab

I have a crontab entry,but it is not working. Can anybody help me in this regard?? (2 Replies)
Discussion started by: Sourav_Paul
2 Replies

3. UNIX for Advanced & Expert Users

Help regarding crontab

Dear All jobs are scheduled in crontab . To view this I use crontab -l . But suddenly today I am not able to see any jobs that is being scheduled in crontab. when I type crontab -l , I am seeing nothing.I am not logging through admin user(i dont have it).But I can schedule jobs through... (3 Replies)
Discussion started by: tkbharani
3 Replies

4. UNIX for Advanced & Expert Users

Crontab help

hi, I run a .sh file using crontab. I need to know the path of the file . Previously when I run the file alone , i used "pwd" but now when using crontab it gives the temp directory of the file. Is there any way I can find the absolute path of the file when i execute it ? Regards, Ranga (7 Replies)
Discussion started by: r_W213
7 Replies

5. Shell Programming and Scripting

Using Crontab

Hi All, I've a shell script which calls a Sybase stored procedure to do some functionality. I want to schedule the running of this script by crontab. I'm using Solaris 5.8. When i executed the following command crontab -l i got the output as crontab: can't open your crontab file How... (10 Replies)
Discussion started by: sumesh.abraham
10 Replies

6. UNIX for Dummies Questions & Answers

crontab

hi all how to schedule the crontab file in unix? (2 Replies)
Discussion started by: ss4u
2 Replies

7. Shell Programming and Scripting

help with crontab

i have a ksh script that creates messages in a temp directory and then sends them out using the sendmail command and i'm trying to set it up to run every night with crontab. So the basic gist of the script is #create temp dir and messages ... #loop through each message and send using sendmail... (3 Replies)
Discussion started by: bob122480
3 Replies

8. UNIX for Dummies Questions & Answers

Crontab

How can I run "crontab" (parameters) every 6 hours on solaris machine? Thanks (1 Reply)
Discussion started by: gen4ik
1 Replies

9. UNIX for Dummies Questions & Answers

about crontab

dear all , does any one now how can i become sure that the crontab that i put was working successfully not by looking for thr result of the sheduled task but from a log for the crontab or something similar and i need to check that the cron i wrote is correct 00 15 * * 0,1,2,3,6... (2 Replies)
Discussion started by: habuzahra
2 Replies

10. UNIX for Dummies Questions & Answers

crontab

Hi I have a shell script which works fine at the command line and does works in crontab also but does not send the output to mail as other scripts do by default. 10 1 * * * /export/home/test/report_script by default should send the output to mail but the script runs OK and the output... (1 Reply)
Discussion started by: run_time_error
1 Replies

Featured Tech Videos