LinuxQuestions.org

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

MrSako 12-16-2006 07: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 08: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 09:11 PM

Try

#chkconfig crond on

and see if that works

MrSako 12-18-2006 06:47 PM

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


# chkconfig crond


returns nothing

unSpawn 12-18-2006 07:15 PM

Install crond, then?

MensaWater 12-18-2006 09: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 02: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 02:04 AM

addendum

perhaps try

chkconfig --list | grep crond

to streamline things

pufrog 12-19-2006 05: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 06: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 08: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 09: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-19-2006 11:15 PM

Have you tried

chkconfig --list | grep crond

yet?

MensaWater 12-20-2006 08: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 08: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?

MensaWater 12-21-2006 11:24 AM

Glad to hear it worked.

3rd party - Not sure what you mean by that. Many packages used in "Linux" distros have their own communities (check out sourceforge to see a plethora of thse). So for example even though Perl typically is installed in most distros it isn't really a "Linux" thing. I began using Perl years ago on HP-UX (Hewlett Packards UNIX). It is an "open source" thing however. Technically "Linux" is only the base kernel. However on most distros the kernel you're using has the work of other communities loaded in as modules.

There are even competing communities. I mentioned vixie-cron because it is the one that came in when I selected to install cron (along with anacron which I let it install though I don't use it). There may be other cron packages that would provide crond but this is the one that Fedora/Redhat community chose. For others you'd have to go search them out (e.g. go to rmpseek site) and might even have to compile them. Of course a lot of admins will tell you to always compile your own for everythng. I know for example there are competing DHCP client software packages. Debian uses dhclient but from a thread I was once in I know there are at least two others.

Being a UNIX admin since 1991 I always try to get the things that seem most like the way I've done it in the UNIX variants I've used assuming there isn't a default preference for the distro being used.

MrSako 12-21-2006 11:35 PM

Quote:

Originally Posted by jlightner
Glad to hear it worked.

3rd party - Not sure what you mean by that. Many packages used in "Linux" distros have their own communities (check out sourceforge to see a plethora of thse). So for example even though Perl typically is installed in most distros it isn't really a "Linux" thing. I began using Perl years ago on HP-UX (Hewlett Packards UNIX). It is an "open source" thing however. Technically "Linux" is only the base kernel. However on most distros the kernel you're using has the work of other communities loaded in as modules.

There are even competing communities. I mentioned vixie-cron because it is the one that came in when I selected to install cron (along with anacron which I let it install though I don't use it). There may be other cron packages that would provide crond but this is the one that Fedora/Redhat community chose. For others you'd have to go search them out (e.g. go to rmpseek site) and might even have to compile them. Of course a lot of admins will tell you to always compile your own for everythng. I know for example there are competing DHCP client software packages. Debian uses dhclient but from a thread I was once in I know there are at least two others.

Being a UNIX admin since 1991 I always try to get the things that seem most like the way I've done it in the UNIX variants I've used assuming there isn't a default preference for the distro being used.

what i mean is theres regular PERL, and then there might be PERL-supermod (which is perl with some kind of twist to it that makes it better for some reason or better for different applications)

MensaWater 12-22-2006 10:33 AM

That all deals with communities of which I spoke. Perl itself has many available modules that can be loaded with CPAN.

So I guess in all that context the answer to your question would be it wasn't 3rd party for the distro you chose but the primary one chosen by that distro's community.


All times are GMT -5. The time now is 10:03 PM.