Crontab help
Moderators: Developers, Moderators
-
- Cacti User
- Posts: 52
- Joined: Fri May 06, 2005 7:39 am
- Location: france
- Contact:
OK--I'm still stumbling along.
I know now that the problem was that I didn't have a crontab for my cactiuser account.
I have that now and this is what is in there.
#Crontab file for cactiuser
*/5**** /www/php/bin/php /www/htdocs/cacti/poller.php > /dev/null 2>&1
I edited the file using gedit, and it let me save and exit fine. If I use vi, I still get the bad minute error?? I'm really not sure what I am doing wrong. I can run this command from terminal fine, but obviously something is not right in crontab. I appreciate all of you all's help.
David
I know now that the problem was that I didn't have a crontab for my cactiuser account.
I have that now and this is what is in there.
#Crontab file for cactiuser
*/5**** /www/php/bin/php /www/htdocs/cacti/poller.php > /dev/null 2>&1
I edited the file using gedit, and it let me save and exit fine. If I use vi, I still get the bad minute error?? I'm really not sure what I am doing wrong. I can run this command from terminal fine, but obviously something is not right in crontab. I appreciate all of you all's help.
David
- rony
- Developer/Forum Admin
- Posts: 6022
- Joined: Mon Nov 17, 2003 6:35 pm
- Location: Michigan, USA
- Contact:
Make sure to look at your syslog to see if cron is executing it. Usually /var/log/cron.log for cron syslog.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
- rony
- Developer/Forum Admin
- Posts: 6022
- Joined: Mon Nov 17, 2003 6:35 pm
- Location: Michigan, USA
- Contact:
/boggle
Never seen that, google that error and see what you can find?
On a side not, on modern linux distrubutions, typically you do not want to edit the /etc/crontab. It maybe get replaced during an update, or such. That is why I always suggest "crontab -e" which edits the user specify crontabs.
Never seen that, google that error and see what you can find?
On a side not, on modern linux distrubutions, typically you do not want to edit the /etc/crontab. It maybe get replaced during an update, or such. That is why I always suggest "crontab -e" which edits the user specify crontabs.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
Rony
From what I can tell--it supposedly means that the stated user in not in my /etc/passwd file.
Obviously, root is there, also cactiuser is in my file. So I am not sure what is going on. I am going to let it rest for a bit and then post on some linux boards to see if anyone on those boards has seen this error.
I truly appreciate the patience/help shown to me on this board. I will be back.
David
From what I can tell--it supposedly means that the stated user in not in my /etc/passwd file.
Obviously, root is there, also cactiuser is in my file. So I am not sure what is going on. I am going to let it rest for a bit and then post on some linux boards to see if anyone on those boards has seen this error.
I truly appreciate the patience/help shown to me on this board. I will be back.
David
If you are using a recent and standard version of Linux, the best way to run the poller is the one in the manual, by editing the file
/etc/crontab
in this file add the line
*/5 * * * * cactiuser php /var/www/html/cacti/poller.php > /dev/null 2>&1
in this line cactiuser tells the cron daemon to run the application as the user cactiuser.
HOWEVER
I have just discovered that for some reason - I dont really see why, cron needs to be restarted for it to read the file. so after every edit, I need to run
service crond restart
OR
/etc/rc.d/init.d/crond restart
and before everyone write to tell me this is wrong - and sends me snippets of the manpage. I know its wrong but I have done quite a lot of testing and cron is only reading the file at startup!!!!
/etc/crontab
in this file add the line
*/5 * * * * cactiuser php /var/www/html/cacti/poller.php > /dev/null 2>&1
in this line cactiuser tells the cron daemon to run the application as the user cactiuser.
HOWEVER
I have just discovered that for some reason - I dont really see why, cron needs to be restarted for it to read the file. so after every edit, I need to run
service crond restart
OR
/etc/rc.d/init.d/crond restart
and before everyone write to tell me this is wrong - and sends me snippets of the manpage. I know its wrong but I have done quite a lot of testing and cron is only reading the file at startup!!!!
Phil
YESSSS!!!!
Hey folks--I got it!!
In my crontab entry I had *5/**** I didn't have any spaces between the *'s(*5/* * * *). I added spaces and everything worked. The no spaces were causing my bad minute errors and evidently it was saving (kind of) my crontab file. This bad file was causing my ~username error in cron log.
Again, I knew it was going to be something simple, but I didn't know what. Thanks again for your help and patience with me. I have been on other boards before, and most are not as cordial and understanding with newbies.
Thanks again,
David
In my crontab entry I had *5/**** I didn't have any spaces between the *'s(*5/* * * *). I added spaces and everything worked. The no spaces were causing my bad minute errors and evidently it was saving (kind of) my crontab file. This bad file was causing my ~username error in cron log.
Again, I knew it was going to be something simple, but I didn't know what. Thanks again for your help and patience with me. I have been on other boards before, and most are not as cordial and understanding with newbies.
Thanks again,
David
- rony
- Developer/Forum Admin
- Posts: 6022
- Joined: Mon Nov 17, 2003 6:35 pm
- Location: Michigan, USA
- Contact:
LOL!!!
I knew it was something simple!!
I knew it was something simple!!
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
Who is online
Users browsing this forum: No registered users and 3 guests