LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-15-2014, 04:47 AM   #1
Nikhil_Lagwankar
Member
 
Registered: Aug 2013
Location: Pune
Distribution: Centos, Ubuntu, Fedora
Posts: 36

Rep: Reputation: 0
Cron Tab Problems !


my cron tab command is

Code:
*/1 * * * * /home/usrname/Desktop/BEproject/call1.sh > /home/usrname/ab.txt
and the file call1.sh is as below.....

Code:
#!/bin/sh
/bin/echo "hi"
/bin/echo "HI"
gcc -o output /home/usrname/Desktop/BEproject/apacheCheck.c
gcc -o output1 /home/usrname/Desktop/BEproject/nginxCheck.c
./output
./output1
The problem is that the file ab.txt gets generated every minute which has the output

Code:
hi
HI
as expected..

however the c codes i have called in call1.sh don't seem to run.
They don't seem to run because the output of those codes is a text file which doesn't get generated.

What is happening?
Need help please ....
 
Old 02-15-2014, 06:05 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
You're compiling stuff into the CWD of the cron job. That's bad behaviour. Let's hope you don't do that as root user. Either cd into the "/home/usrname/Desktop/BEproject/" directory or create a temporary directory first.
 
1 members found this post helpful.
Old 02-15-2014, 08:43 PM   #3
Nikhil_Lagwankar
Member
 
Registered: Aug 2013
Location: Pune
Distribution: Centos, Ubuntu, Fedora
Posts: 36

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by unSpawn View Post
You're compiling stuff into the CWD of the cron job. That's bad behaviour. Let's hope you don't do that as root user. Either cd into the "/home/usrname/Desktop/BEproject/" directory or create a temporary directory first.
That did it! Thanks...
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cron Tab talat Solaris / OpenSolaris 1 06-07-2007 12:04 AM
cron tab user52 Linux - Newbie 3 11-29-2006 06:53 AM
help in cron tab framedrelay Programming 1 11-15-2006 07:49 AM
cron tab, what do you use it for? Fritz_Monroe Linux - Newbie 12 09-28-2006 02:54 PM
cron tab thefedexguy SUSE / openSUSE 4 07-06-2006 11:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration