cron questions

Other talk about Salix
Post Reply
toothandnail
Posts: 165
Joined: 20. Sep 2009, 17:30
Location: Oxfordshire, UK

cron questions

Post by toothandnail »

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.
User avatar
deja69
Posts: 89
Joined: 23. Apr 2012, 00:20

Re: cron questions

Post by deja69 »

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
Tim CowChip
Posts: 304
Joined: 27. May 2011, 03:35
Location: Cascade Locks, OR

Re: cron questions

Post by Tim CowChip »

Code: Select all

sudo /usr/sbin/crond restart
does

Code: Select all

crontab -l
show your cron file?
ImageImage
User avatar
thenktor
Salix Wizard
Posts: 2426
Joined: 6. Jun 2009, 14:47
Location: Franconia
Contact:

Re: cron questions

Post by thenktor »

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)
geBIERt (German beer blog)
toothandnail
Posts: 165
Joined: 20. Sep 2009, 17:30
Location: Oxfordshire, UK

Re: cron questions

Post by toothandnail »

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

Post by toothandnail »

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

Post by toothandnail »

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.
Post Reply