LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   no crontab? (http://www.linuxquestions.org/questions/linux-software-2/no-crontab-511207/)

MrSako 12-16-2006 08:11 PM

no crontab?
 
before i made cronjobs using the "crontab" command (this is on centos 4) after reinstalling my entire server (including the OS) i haven't been able to figure out the cronjob/crontab thing. first of all it doesnt seem to take notice of the existance of a crontab command (says command not found) i did use yum install crontabs to install it (but i think its just a related to crontabs installation) i see the crontab files inside my /etc directory and i tried writing in a new cronjob that i want and saved the file. but it is not working.


any ideas?

edit:

ps aux | grep crond

does not show crond running, and i do not see an entry for it in chkconfig --list to turn it on. so somehow/someway crond wasnt installed at all?

(i dont know where else to find it to start it up, i look around but with no luck, this is on a server which i rent and have root access to, by reinstalling the server all i mean is that i pressed the button on the website to "rebuild" my server. perhaps the script did not include installing crontab etc

MensaWater 12-16-2006 09:37 PM

What does "rpm -qa |grep cron" show?

Crontabs are created in /var/spool/cron. They will have the name of the user.

Crond should be running.

If it says command not found it either means you don't have it or you just don't have a path to it.

The file in /var/spool/cron isn't created until you add something to cron with "crontab -e". You can list it with "crontab -l" if it has anything. For a test you could just add a comment to it. You should edit with the -e rather than doing a vi on the file.

billymayday 12-16-2006 10:11 PM

Try

#chkconfig crond on

and see if that works

MrSako 12-18-2006 07:47 PM

# rpm -qa | grep cron
crontabs-1.10-7


# chkconfig crond


returns nothing

unSpawn 12-18-2006 08:15 PM

Install crond, then?

MensaWater 12-18-2006 10:32 PM

crontabs only puts in:
/etc/cron.daily
/etc/cron.hourly
/etc/cron.monthly
/etc/cron.weekly
/etc/crontab
/usr/bin/run-parts

You can see that by typing "rpm -ql crontabs".

On my FC4 (which has the same version of crontabs you have) I also have vixie-cron which is what provides crond among other things:
rpm -ql vixie-cron
/etc/cron.d
/etc/pam.d/crond
/etc/rc.d/init.d/crond
/etc/sysconfig/crond
/usr/bin/crontab
/usr/sbin/crond
/usr/share/man/man1/crontab.1.gz
/usr/share/man/man5/crontab.5.gz
/usr/share/man/man8/cron.8.gz
/usr/share/man/man8/crond.8.gz
/var/spool/cron

Not sure if that's available for CentOS but suspect it is. If you're running yum you can do "yum whatprovides /usr/sbin/crond" or if that returns nothing "yum whatprovides crond". You can then use yum to install the package it shows.

billymayday 12-19-2006 03:02 AM

chkconfig crond won't return anything

chkconfig on

should set it to run in default runlevels

type

chkconfig --list

to see if crontab thinks it's there (it may be set to off in all runlevels)

if it's there but listed as off at all levels, type chkconfig crond on

billymayday 12-19-2006 03:04 AM

addendum

perhaps try

chkconfig --list | grep crond

to streamline things

pufrog 12-19-2006 06:35 PM

cron crontab crontabs et all
 
I have just strated running Puppy Linux & having followed this thead for a few days I find that nothing suggested works for me.
After doing some sniffing thru the file system structure,
I find that Puppy is not arranged at all like Debian, the only other system that I am some what familiar with.
QUESTION: Are all, or most, of the other main stream Linux distros so different from each other also.?
I am extremely frustrated w/ Linux so far, even though
I think its basic principles are fantastic. I want to make
Debian my "main" distro, but thought I could learn some things from Puppy. Puppy is the only distro of 4-5 I have laying around the house that came up with out a problem.
But now that it is up it I have trouble getting it to do what I want. Their cron GUI does not make sense and does not work. So, cron does not work on either disrto ... yet ... but it will, it will.
However, to Puppy's credit, it did allow an easy path to using my external Hayes modem AND gettting on the NET.
For this I am very glad and pleased. Something I have not yet been able to do on Debian.

Sheesh, what a way to have fun.!!
Any comments.? -- and thanks for "listening".

MensaWater 12-19-2006 07:47 PM

Haven't used Puppy. Am aware the Ubuntu/Edgy are Debian derived.

Fedora, Redhat and Centos (and VMware) are RedHat derived.

The great thing about Open Source is you can configure things any way you want. The down side to Open Source is that people do that. :rolleyes:

Debian and Redhat are definitely different.

The idea is to pick the flavor whose philosophy most closely matches yours (or better yet most closely matches your requirements). There are a lot of Linux folks that install different versions over and over (a great use for VMware by the way) just to see if there is anything they like about it. (Can you say geeks?) :D

billymayday 12-19-2006 09:17 PM

Just as an aside, be careful jumping into threads and (I think it's called) hijacking. Some people get ver peeved off when it happens

MrSako 12-19-2006 10:51 PM

Quote:

Originally Posted by jlightner
crontabs only puts in:
/etc/cron.daily
/etc/cron.hourly
/etc/cron.monthly
/etc/cron.weekly
/etc/crontab
/usr/bin/run-parts

You can see that by typing "rpm -ql crontabs".

On my FC4 (which has the same version of crontabs you have) I also have vixie-cron which is what provides crond among other things:
rpm -ql vixie-cron
/etc/cron.d
/etc/pam.d/crond
/etc/rc.d/init.d/crond
/etc/sysconfig/crond
/usr/bin/crontab
/usr/sbin/crond
/usr/share/man/man1/crontab.1.gz
/usr/share/man/man5/crontab.5.gz
/usr/share/man/man8/cron.8.gz
/usr/share/man/man8/crond.8.gz
/var/spool/cron

Not sure if that's available for CentOS but suspect it is. If you're running yum you can do "yum whatprovides /usr/sbin/crond" or if that returns nothing "yum whatprovides crond". You can then use yum to install the package it shows.

# yum provides /usr/sbin/crond
Searching Packages:
Setting up repositories
Reading repository metadata in from local files


vixie-cron.x86_64 4:4.1-44.EL4 base
Matched from:
/usr/sbin/crond


there seems to be a version of this vixie thing for my distro.

what exactly is it though? how different is it to use/whats different about it?

billymayday 12-20-2006 12:15 AM

Have you tried

chkconfig --list | grep crond

yet?

MensaWater 12-20-2006 09:55 AM

It appears the crontabs package only provides the crontab files (as seen above) but not the actual executables to run cron. (FYI: These are specialized files - I don't actually use these - I prefer doing cron via crontab -e which makes the user specific crontab files I'd mentioned in an earlier post.)

It is vixie-con that provides the executables along with other components. Notice it includes the init.d script that would be used for ckconfig to turn it on/off.

You should just run "yum install vixie-cron.x86_64 4:4.1-44.EL4 base" to install it.

Amazing how many posts here keep telling you to run ckconfig when it is clear from your earlier post that you don't have crond installed at all. AFTER you do the above INSTALL you should be able to run "ckconfig --list crond" to see if it is set to run automatically. On mine I have:
crond 0: off 1: off 2: on 3: on 4: on 5: on 6: off

Also you can run "service crond status" to see if it started automatically on the install. If not running "service crond start" will start it.

P.S. It may be that during your original install you saw "anacron" which is a somewhat different animal so didn't think you needed vixie-cron. I have anancron installed but never use it.

MrSako 12-20-2006 09:19 PM

ok it works fine now thanks :)

i thought vixie-cron was a 3rd party personal version of it (like anacron) i guess not?


All times are GMT -5. The time now is 09:54 PM.