[Solved] Crontab not launching script


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users [Solved] Crontab not launching script
# 1  
Old 12-13-2012
[Solved] Crontab not launching script

Hi all,
i have the following script
Code:
#!/bin/sh
for i in `ps -leaf --cols 1024 | grep LogUser | grep -v grep | awk '{print $4}'`;
  do
    echo $i
    kill -15 $i;
done;

but it seems that the crontab its sciping this script,i configured corntab as following
Code:
*/30 * * * root /opt/logger/bin/restart.sh

i'm not getting any error but crontab its simply ignoring my script,
btw i also checked if crontab its running and it is ok,

any idea?

Thanks in advance.
# 2  
Old 12-13-2012
Why have you written "root" in the crontab? I guess that's a mistake and should not be there? That leaves just four time fields. There should be 5.
This User Gave Thanks to Scott For This Post:
# 3  
Old 12-13-2012
Quote:
Originally Posted by Scott
Why have you written "root" in the crontab? I guess that's a mistake and should not be there? That leaves just four time fields. There should be 5.

Thanks a lot for quick response mate,
that was the problem, solved

Code:
*/30 * * * * root /opt/logger/bin/restart.sh

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Statement returning error only launching the sh script via crontab

hi all, I created a sh script to import some tables from mysql to hive. No problem launching it manually, but if I schedule via crontab it returns me an error in the following part: #create an array containing all the tables for $dbname query="SELECT table_name FROM information_schema.tables'... (10 Replies)
Discussion started by: mfran2002
10 Replies

2. Shell Programming and Scripting

Launching mplayer from within Links2 using a shell script

I'm using the Links2 console web browser in graphical mode (the "-g" argument), and launching a shell script that invokes MPlayer from within it. MPlayer works fine. No problem there. The problem, is that I have no control over the MPlayer process. I would like to be able to exit MPlayer whenever... (16 Replies)
Discussion started by: ignatius
16 Replies

3. UNIX for Dummies Questions & Answers

[Solved] Error while updating the crontab

When I update the crontab, I get error message. Any idea? 0 0-23 * * * /usr/local/scripts/monitor.sh > /dev/null ( BEFORE) */5 * * * * /usr/local/scripts/monitor.sh > /dev/null (Now) it doesn't allow me to save the work. Error message... crontab: */5 * * * *... (3 Replies)
Discussion started by: samnyc
3 Replies

4. UNIX for Dummies Questions & Answers

[Solved] Crontab

Hi I need my script to run at 7:30, 7:40, 7:50 & 8:00 AM. Defined like: 30,40,50 7,8 * * * sh myscript.sh But this runs even at 8:30, 8:40, 8:50 - which I don't need.. Please advise. (4 Replies)
Discussion started by: ashokvpp
4 Replies

5. Shell Programming and Scripting

[Solved] Shell script not working in crontab

Hi Iam running below script in crontab but its not working. #!/bin/sh cd /Scripts /usr/local/bin/expect -f /Scripts/bng_backup.exp /Scripts/data.txt tar -cf bngbackup.tar bngbackup ;gzip bngbackup.tar when iam running manually the output file is generating..but bngbackup.tar.gz file... (5 Replies)
Discussion started by: surender reddy
5 Replies

6. UNIX for Dummies Questions & Answers

[Solved] crontab scheduling

Hi, We can schedule a new job using crontab -e. is there any other way to achieve the same(opening the file directly and add an entry). I have tried to access /var/spool/crontabs directory. But i am getting permission denied error, Please help me. Thanks (8 Replies)
Discussion started by: pandeesh
8 Replies

7. Red Hat

Help in launching firefox.

Hi, -- I am new to linux, please bear with my tech terms. I am using Red Hat 4.1.2-48 (Linux version 2.6.18-194.11.1.el5) for the project. This is a remote server and I do not use any GUI. Now I need to install a product that requires me to launch firefox from linux. when i am trying... (3 Replies)
Discussion started by: vj8436
3 Replies

8. HP-UX

[Solved] crontab issue "day of week"

Is there an issue with running a cron entry like the below entries? 0 2 21 12 2 cd /usr/local/bin;./cksecurity.sh -f /home/theninja/security.dat21 I wanted this to run on Tues at 2am, which it did successfully, however I also had the following entry to run next tuesday that also ran on 12/21.... (3 Replies)
Discussion started by: theninja
3 Replies

9. Shell Programming and Scripting

Launching a C program that needs input from a shell script

hi there, i need some help, i am trying to run a script to launch a C program and a Java program but before running both I want to get a user input and then invoke both programs with input received. In the programs the inputs are not command line arguments. This is the code, after the java... (4 Replies)
Discussion started by: momal
4 Replies

10. UNIX for Dummies Questions & Answers

launching script via REXEC

Hi folks! my client uses an winapplication which is launching shell-scripts remotely on a HP-Unix Machine via Rexec. The application-configuration is launching the script (which is in the home directory of connecting user) like: rexec host user pass shell.sh So far so good, everything... (3 Replies)
Discussion started by: JohnMurdoch
3 Replies
Login or Register to Ask a Question