d_terano
asked on
using cron
Hi there,
i've 2 questions:
Question 1 (using cron)
-------------------------- -
I'm trying to make a script work every 5 minutes. This is what i've done. Do tell me what is wrong and how to rectify the problem:
1. in the command prompt> crontab -e
2. I inserted this line to make the script run every 5 minutes. (the script is stored on my Desktop)
5 * * * * userName /home/userName/Desktop/scr iptName
Then i saved and exited the file. Afterthat i waited for 5 minutes and more... but nothing happens... what's wrong?
Instead of running a script, i run a command instead for example:
5 * * * * userName /bin/echo cron successfull
Again, nothing happens...
Question 2 (script -> executable)
-------------------------- ---------- --
After writing a script, running it would mean prompt> ./scriptName arg1 arg2 ...
however, is it possible to make that script into an executable file? How?
Thanks.
d_terano
i've 2 questions:
Question 1 (using cron)
--------------------------
I'm trying to make a script work every 5 minutes. This is what i've done. Do tell me what is wrong and how to rectify the problem:
1. in the command prompt> crontab -e
2. I inserted this line to make the script run every 5 minutes. (the script is stored on my Desktop)
5 * * * * userName /home/userName/Desktop/scr
Then i saved and exited the file. Afterthat i waited for 5 minutes and more... but nothing happens... what's wrong?
Instead of running a script, i run a command instead for example:
5 * * * * userName /bin/echo cron successfull
Again, nothing happens...
Question 2 (script -> executable)
--------------------------
After writing a script, running it would mean prompt> ./scriptName arg1 arg2 ...
however, is it possible to make that script into an executable file? How?
Thanks.
d_terano
You need to restart Crond to activate changes.
type this command:
service crond restart
type this command:
service crond restart
" You need to restart Crond to activate changes. "
No you dont.
No you dont.
ASKER
liddler,
I'll try ur suggestion ASAP. As for the question 2.... yes i mean to prevent people looking at the source code...
do i use "make" to do that? if yes, are there any other way to do it besides using "make"?
thanks
regards,
d_terano
I'll try ur suggestion ASAP. As for the question 2.... yes i mean to prevent people looking at the source code...
do i use "make" to do that? if yes, are there any other way to do it besides using "make"?
thanks
regards,
d_terano
for Q 2 take a look at this
https://www.experts-exchange.com/questions/20780230/Copy-protection-of-a-korn-shell-script.html
https://www.experts-exchange.com/questions/20780230/Copy-protection-of-a-korn-shell-script.html
ASKER
for Q1:
--------
I've tried out the suggestion given by liddler. This is the error message that was mailed to me:
From root Tue Nov 11 12:05:00 2003
Return-Path: <root@localhost.localdomai n>
Received: (from root@localhost)
by localhost.localdomain (8.11.6/8.11.6) id hAB250B02246
for root; Tue, 11 Nov 2003 12:05:00 +1000
Date: Tue, 11 Nov 2003 12:05:00 +1000
Message-Id: <200311110205.hAB250B02246 @localhost .localdoma in>
From: root@localhost.localdomain (Cron Daemon)
To: root@localhost.localdomain
Subject: Cron <root@localhost> root /bin/echo crond successfull
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=root>
/bin/sh: root: command not found
What's wrong?
for Q2:
--------
is it possible to use "make" to convert a bash script to an executable (binary) file?
thanks.
--------
I've tried out the suggestion given by liddler. This is the error message that was mailed to me:
From root Tue Nov 11 12:05:00 2003
Return-Path: <root@localhost.localdomai
Received: (from root@localhost)
by localhost.localdomain (8.11.6/8.11.6) id hAB250B02246
for root; Tue, 11 Nov 2003 12:05:00 +1000
Date: Tue, 11 Nov 2003 12:05:00 +1000
Message-Id: <200311110205.hAB250B02246
From: root@localhost.localdomain
To: root@localhost.localdomain
Subject: Cron <root@localhost> root /bin/echo crond successfull
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=root>
/bin/sh: root: command not found
What's wrong?
for Q2:
--------
is it possible to use "make" to convert a bash script to an executable (binary) file?
thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
liddler,
thanks a lot for your help! appreciate it...
regards,
d_terano
thanks a lot for your help! appreciate it...
regards,
d_terano
0,5,10,15,20,25,30,35,40,4
2. A script is made executeable using chmod a+x scriptName.
Or do you mean compiling a script into a binary file (Usually to stop people looking at the source code)