cron questions

Other talk about Salix

cron questions

Postby toothandnail » 24. Apr 2012, 23:18

Two dumb cron questions. I've not really ever had to make changes to cron in Slackware or Slack-based distros, so I'm a bit lost....

First, is there anything special I need to do to get a crontab recognized? I need the extra granularity it provides, but even though I've added /etc/crontab, it doesn't seem to be being picked up. I'm using this sort of format:

30 1 * * * * root <path-to-command-to-execute>

Second, how do I restart crond? A google search found some mention of /etc/init.d/cron restart, but there is no cron file in init.d, so I'm a bit lost there as well.

Paul.
toothandnail
 
Posts: 165
Joined: 20. Sep 2009, 17:30
Location: Oxfordshire, UK

Re: cron questions

Postby deja69 » 25. Apr 2012, 00:03

Im by no means a geek,and im sure someone more clued up will get to you soon.
But this link might give you a head start maybe :?:
http://www.unixgeeks.org/security/newbi ... ron-1.html
http://www.foogazi.com/2006/12/07/under ... 5-minutes/
Best of luck toothandnail :D
User avatar
deja69
 
Posts: 89
Joined: 23. Apr 2012, 00:20

Re: cron questions

Postby Tim CowChip » 25. Apr 2012, 02:00

Code: Select all
sudo /usr/sbin/crond restart

does
Code: Select all
crontab -l

show your cron file?
ImageImageImage
User avatar
Tim CowChip
 
Posts: 273
Joined: 27. May 2011, 03:35
Location: in a van down by the river

Re: cron questions

Postby thenktor » 25. Apr 2012, 07:39

You can edit the crontab with crontab -e and the file for root is located at /var/spool/cron/crontabs/root.
Image
burnCDDA (burns audio CDs)
last.fm (my last.fm profile)
User avatar
thenktor
Salix Wizard
 
Posts: 2397
Joined: 6. Jun 2009, 14:47
Location: Franconia

Re: cron questions

Postby toothandnail » 25. Apr 2012, 07:47

deja69 wrote:Im by no means a geek,and im sure someone more clued up will get to you soon.
But this link might give you a head start maybe :?:
http://www.unixgeeks.org/security/newbi ... ron-1.html
http://www.foogazi.com/2006/12/07/under ... 5-minutes/
Best of luck toothandnail :D


:) Thanks. Found the problem, eventually. Those are useful references.

Paul.
toothandnail
 
Posts: 165
Joined: 20. Sep 2009, 17:30
Location: Oxfordshire, UK

Re: cron questions

Postby toothandnail » 25. Apr 2012, 07:49

Tim CowChip wrote:
Code: Select all
sudo /usr/sbin/crond restart



Thanks. I was expecting a script in /etc/rc.d, which is what threw me.

does
Code: Select all
crontab -l

show your cron file?


No, but it did point me in the right direction. Too much time spent with Red Hat derived distros.

Paul.
toothandnail
 
Posts: 165
Joined: 20. Sep 2009, 17:30
Location: Oxfordshire, UK

Re: cron questions

Postby toothandnail » 25. Apr 2012, 07:52

thenktor wrote:You can edit the crontab with crontab -e and the file for root is located at /var/spool/cron/crontabs/root.


Thanks. That's what I did in the end. Which showed a completely different crontab to the one I'd created. Knowing where the operational crontab is stored helps as well.

I look after a number of SME servers (SME is CentOS based). CentOS stores a single crontab in /etc. and specifies a user on each command. Must be a different cron implementation. I think I prefer the Slack way...

Paul.
toothandnail
 
Posts: 165
Joined: 20. Sep 2009, 17:30
Location: Oxfordshire, UK


Return to Misc