Results 1 to 10 of 11
hi.. im typing this into my terminal for a cron job
Code:
37 9 * * 1-7 myusername /home/user/myshell
but i get this error
Code:
bash: 37: command not found
...
- 03-08-2008 #1
CRON error
hi.. im typing this into my terminal for a cron job
but i get this errorCode:37 9 * * 1-7 myusername /home/user/myshell
what am i doing wrong?Code:bash: 37: command not found
- 03-08-2008 #2Linux Enthusiast
- Join Date
- Aug 2006
- Posts
- 631
Use the whole path to the script since cron jobs may not provide the same working environment (path, aliases, etc.), for instance:
RegardsCode:37 9 * * 1-7 /dir/of/the/script/myusername /home/user/myshell
- 03-08-2008 #3Linux User
- Join Date
- Jun 2007
- Posts
- 318
Sounds like you weren't in the editor. Did you issue this command before trying to add the cron job?
Code:crontab -e
- 03-08-2008 #4
- 03-08-2008 #5
I find the standard man pages quite informative.
Or for a web-format goto:Code:man 5 crontab
crontab(5)
- 03-08-2008 #6
am i write to understand that you write the cronjob in the crontab,.
SAVE it..
then in a standard terminal run the saved cronjob?
im very confused.. i understand the syntax of cron, i just dont know how to execute or run it.
im using the crontab, i type in my command.. but then nothign happens.. so im asusming a save needs to be made and then run in terminal.. or am i wrong.. please help!
- 03-08-2008 #7Linux Enthusiast
- Join Date
- Aug 2006
- Posts
- 631
Suppose you have your script at the location /home/mydir/ with the name myscript.
Make your script is executable (chmod), type crontab -e and place the command:
save the crontab and wait until 15:15 pmCode:15 15 * * 1-7 /home/mydir/myscript
.
That's all.
Regards
- 03-08-2008 #8
when u say save the script... do i just save it in my home directory... say if i call it mycron
save it in: home/myuser/mycron
just like that? and wait
- 03-08-2008 #9
ok, i done exactly this:
to test, i made it run 3 times in the space of 30min..
using crontab -e i typed:
then i saved this file in myuser directory and called it cronjobCode:0 13 * * 1-7 /home/user/myshell 15 13 * * 1-7 /home/user/myshell 30 13 * * 1-7 /home/user/myshell
i made sure that myshell is executable using chmod.
still nothing happens!???!?!??!


there must be something that i am missing here!
- 03-08-2008 #10


Reply With Quote
