Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 07-14-2007, 01:47 PM   #1
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, 01:54 PM   #2
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: 335Reputation: 335Reputation: 335Reputation: 335
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/.


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

All times are GMT -5. The time now is 11:18 PM.

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