LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 07-14-2007, 12:47 PM   #1
bhandu
LQ Newbie
 
Registered: Mar 2006
Posts: 22

Rep: Reputation: 15
Exclamation Command for executing C program in crontab


I have a "C" program "test.c" stored in /etc directory path. To execute this program thru crontab I have written the following entry in cron file as follows


52 1 * * *

But what is the commmand to be entered in the command to execute this script?
 
Old 07-14-2007, 12:54 PM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 326Reputation: 326Reputation: 326Reputation: 326
A C program is not a script; it is source code that must be compiled before use. You can compile the program and then invoke it from cron with its (fully qualified) name. For example, if you compile "test.c" to the executable "test", and place it in /usr/local/bin, your cron entry would be:

52 1 * * * /usr/local/bin/test

You should not place executables in the /etc directory; that is not where they belong. The /etc directory is for configuration parameters. Executables should be placed in a bin directory. Locally created executables that are available system-wide should be in /usr/local/bin/.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Know of a command executing program for LIRC? Titan2k Linux - Software 2 04-07-2007 08:11 PM
Executing program as non-root arip Programming 4 12-01-2005 05:41 AM
executing a program as root funkymunky Linux - General 2 05-06-2005 12:48 PM
executing a program in new terminal? kashifbilal Programming 7 04-26-2004 04:52 AM
Executing a program with out system() in c++ sobdk Programming 2 11-02-2002 07:45 AM


All times are GMT -5. The time now is 09:06 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration