Results 1 to 7 of 7
Hello guys!!
This is my first post in this wonderful community, by just browsing this forum i leanred soo much about linux!
Anyways, i have a questions about cron jobs ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 03-16-2005 #1Just Joined!
- Join Date
- Mar 2005
- Posts
- 3
Cron jobs - how to? - SSH - Time in command line?
Hello guys!!
This is my first post in this wonderful community, by just browsing this forum i leanred soo much about linux!
Anyways, i have a questions about cron jobs on SSH
note: i am a noobie.
other notes: i am using a client called "PuTty" for SSH.
I am running CentOs (same as linux redhat)
I would like to setup cronjobs (sceduled task) on 3 files to run every 3 minute.
This is for a mail script that is suppose to check for mail and send me support tickets.
The files are located in a folder on my server
(absolute path : home/domain/www/support/email/users.php / techmail.php / mail.php)
I am having trouble figuring out what path to type in the SSH command line, although i do know that my command would have to look somthing like this:
*/1 * * * -wget -q [path to file]
please remember i am a noobie so do not laugh if my command makes no sense
My second question is, whats he difference between "command line version of php" and "apache module of php"
Last question: I was following a tutorial last night and i was typing in a command in SSH as directed by the tut (it was a cronjob)
and whenever i typed in the time which was represented by ( 0 3 * * * )
for 3am... SSH would say that the command is invalid, and whever i ran the cron without that part (0 3 * * *) it would work and apply the cron ONCE only. so i guess my concern is.. how do i type in the time in correct format on the command line for SSH ?
is it 0 3 *** with no spaces?
or 0 3 * * * spaced out?
Sorry for being ignorant but an answer to my questions would def brighten me up!!!
Thanks for reading!
Ben.
- 03-16-2005 #2Linux User
- Join Date
- Feb 2005
- Posts
- 290
as a normal user, i do crontab this way:
edit my crontab file (say /home/adam/mycrontab) and put the following:
thenCode:# minutes hours day_of_month month day_of_week /usr/bin/command_to_be_run 1 * * * * /run/this/every/1st/minute
as root user, you can always edit /etc/crontab and save the trouble of having to edit the file then |crontab again.Code:[adam@linux] $ cat /home/adam/mycrontab | crontab
good luck
- 03-17-2005 #3
Modern distro's come with a different way of specifying crontabs. There is this set of directories in /etc (cron.*) where you can place executable scripts. But that is mainly designed to run as root.
The entry wich will give you a job every 3 minutes looks like this:
This is with spaces. To edit your cron entries useCode:#<minute> <hour> <day> <month> <dow> <command> /3 * * * * /home/user/command
rather then editing files using some editor. The user part is optional and can be used by root to edit some user crontab.Code:crontab -e <user>
I\'m so tired .....
#200472
- 03-17-2005 #4Linux User
- Join Date
- Feb 2005
- Posts
- 290
yeap, but i doubt a newbie would really love to vi in that way :P
Originally Posted by puntmuts
- 03-17-2005 #5That is true, but a broken crontab data file doesn't help the newbie either, and some basic vi is part of the game
Originally Posted by adam7979
I\'m so tired .....
#200472
- 03-21-2005 #6Linux Enthusiast
- Join Date
- Jun 2002
- Location
- San Antonio
- Posts
- 621
Another way to do this is with the nano editor, which comes as an alternate in RedHat (and thus in centOS). You can run:
Then in here, _THIS_ is where you enter the code for the crontab. In this case it is:Code:EDITOR=/usr/bin/nano crontab -e
Best,Code:*/3 * * * * wget -q http://test.com/test.php
SamuelI respectfully decline the invitation to join your delusion.
- 03-21-2005 #7Just Joined!
- Join Date
- Mar 2005
- Posts
- 3
you guys are too good!
thanks so much for the input, all of you!
cheers,
ben


Reply With Quote
