[arch-general] Stuff in /etc/cron.d/ won't work?
Hey there, I just noticed that I just couldn't get cron to properly execute stuff in /etc/cron.d/ no matter what I did. Let's say I have /etc/cron.d/lol with this content: * * * * * root echo "lol" >> /tmp/omg and restart crond afterwards, the crond log tells me that cron actually runs this command every minute without a problem. Sadly, this isn't the case and the file at /tmp/omg is created but remains without contents. In contrast, if I put an executable script to /etc/cron.hourly/lol with the content: echo "lol" >> /tmp/omg then the file at /tmp/omg fills up with lots of "lol"s after a couple of hours. It also works fine if I put it into the crontab. Now, I'd like to be able to use /etc/cron.d/ as well because it seems more transparent to me. Is there anything I do inherently wrong? -- Sven-Hendrik
the crond log tells me that cron actually runs this command every minute without a problem i think you mis-read your log. and it should tell you that cron is looking for changes in /etc/cron.d every minute. may be, if you change you first * * * in your lol then may be it will work. assuming you're using the good cron. because fcron does not support /etc/cron.d but there is other ways to achieve the same thing.
check crond man page or its documentation
On 25.08.2009 12:51, solsTiCe d'Hiver wrote:
the crond log tells me that cron actually runs this command every
minute without a problem i think you mis-read your log. and it should tell you that cron is looking for changes in /etc/cron.d every minute. may be, if you change you first * * * in your lol then may be it will work. assuming you're using the good cron. because fcron does not support /etc/cron.d but there is other ways to achieve the same thing.
check crond man page or its documentation
I'm using dcron and also I didn't misread. Also, dcron doesn't look for changes in said directory without restarting from what I have found out. It actually tells me what it is going to execute and that is my /etc/cron.d/lol file. It would report and error otherwise. The thing that strikes me is that the command doesn't actually do anything. echo is a shell built-in of sh, bash, any shell really so env vars shouldn't be an issue. Any ideas?
Would your script needs a shebang? 2009/8/25 Sven-Hendrik Haase <sh@lutzhaase.com>
On 25.08.2009 12:51, solsTiCe d'Hiver wrote:
the crond log tells me that cron actually runs this command every
minute without a problem i think you mis-read your log. and it should tell you that cron is looking for changes in /etc/cron.d every minute. may be, if you change you first * * * in your lol then may be it will work. assuming you're using the good cron. because fcron does not support /etc/cron.d but there is other ways to achieve the same thing.
check crond man page or its documentation
I'm using dcron and also I didn't misread. Also, dcron doesn't look for changes in said directory without restarting from what I have found out. It actually tells me what it is going to execute and that is my /etc/cron.d/lol file. It would report and error otherwise. The thing that strikes me is that the command doesn't actually do anything. echo is a shell built-in of sh, bash, any shell really so env vars shouldn't be an issue.
Any ideas?
On 25.08.2009 22:21, Nicolas Bigaouette wrote:
Would your script needs a shebang?
2009/8/25 Sven-Hendrik Haase <sh@lutzhaase.com>
On 25.08.2009 12:51, solsTiCe d'Hiver wrote:
the crond log tells me that cron actually runs this command every
minute without a problem i think you mis-read your log. and it should tell you that cron is looking for changes in /etc/cron.d every minute. may be, if you change you first * * * in your lol then may be it will work. assuming you're using the good cron. because fcron does not support /etc/cron.d but there is other ways to achieve the same thing.
check crond man page or its documentation
I'm using dcron and also I didn't misread. Also, dcron doesn't look for changes in said directory without restarting from what I have found out. It actually tells me what it is going to execute and that is my /etc/cron.d/lol file. It would report and error otherwise. The thing that strikes me is that the command doesn't actually do anything. echo is a shell built-in of sh, bash, any shell really so env vars shouldn't be an issue.
Any ideas?
No, stuff in /etc/cron.d/ looks just like stuff in your crontab and gets executed by the shell mentioned in $SHELL. Still, it wouldn't matter because I'm using a built-in here. I'm really baffled by this.
On Tue, Aug 25, 2009 at 7:46 PM, Sven-Hendrik Haase<sh@lutzhaase.com> wrote:
On 25.08.2009 22:21, Nicolas Bigaouette wrote:
Would your script needs a shebang?
2009/8/25 Sven-Hendrik Haase <sh@lutzhaase.com>
On 25.08.2009 12:51, solsTiCe d'Hiver wrote:
the crond log tells me that cron actually runs this command every
minute without a problem i think you mis-read your log. and it should tell you that cron is looking for changes in /etc/cron.d every minute. may be, if you change you first * * * in your lol then may be it will work. assuming you're using the good cron. because fcron does not support /etc/cron.d but there is other ways to achieve the same thing.
check crond man page or its documentation
I'm using dcron and also I didn't misread. Also, dcron doesn't look for changes in said directory without restarting from what I have found out. It actually tells me what it is going to execute and that is my /etc/cron.d/lol file. It would report and error otherwise. The thing that strikes me is that the command doesn't actually do anything. echo is a shell built-in of sh, bash, any shell really so env vars shouldn't be an issue.
Any ideas?
No, stuff in /etc/cron.d/ looks just like stuff in your crontab and gets executed by the shell mentioned in $SHELL. Still, it wouldn't matter because I'm using a built-in here. I'm really baffled by this.
For the record, I've always had issues with this myself. I remedied it by simply putting things in root's crontab, but that's not a proper solution. If you can figure out how to get /etc/cron.d/ working as it should, I will love you forever
On 26.08.2009 05:10, Aaron Griffin wrote:
On Tue, Aug 25, 2009 at 7:46 PM, Sven-Hendrik Haase<sh@lutzhaase.com> wrote:
On 25.08.2009 22:21, Nicolas Bigaouette wrote:
Would your script needs a shebang?
2009/8/25 Sven-Hendrik Haase <sh@lutzhaase.com>
On 25.08.2009 12:51, solsTiCe d'Hiver wrote:
the crond log tells me that cron actually runs this command every
minute without a problem i think you mis-read your log. and it should tell you that cron is looking for changes in /etc/cron.d every minute. may be, if you change you first * * * in your lol then may be it will work. assuming you're using the good cron. because fcron does not support /etc/cron.d but there is other ways to achieve the same thing.
check crond man page or its documentation
I'm using dcron and also I didn't misread. Also, dcron doesn't look for changes in said directory without restarting from what I have found out. It actually tells me what it is going to execute and that is my /etc/cron.d/lol file. It would report and error otherwise. The thing that strikes me is that the command doesn't actually do anything. echo is a shell built-in of sh, bash, any shell really so env vars shouldn't be an issue.
Any ideas?
No, stuff in /etc/cron.d/ looks just like stuff in your crontab and gets executed by the shell mentioned in $SHELL. Still, it wouldn't matter because I'm using a built-in here. I'm really baffled by this.
For the record, I've always had issues with this myself. I remedied it by simply putting things in root's crontab, but that's not a proper solution. If you can figure out how to get /etc/cron.d/ working as it should, I will love you forever
From web searches, it appears that dcron's support for /etc/cron.d is somewhat wacky and not guaranteed to work. I think having a look at bcron might be worth it. Find it here: http://untroubled.org/bcron/ and find the AUR package here: http://aur.archlinux.org/packages.php?ID=6841. A somewhat old assessment of available cron daemons by bcron's author can be found here: http://untroubled.org/bcron/old/bcron_1.html. Out of interest, I just looked up what other distros use for their cron system and surprise! Ubuntu and Debian both use bcron and /etc/cron.d works alright. I shall hereby request changing Arch's default cron daemon to bcron in order to fix the /etc/cron.d issues, to make Arch seem more modern and to make Aaron love me forever (whatever it is that will subsequently happen from that).
On 26.08.2009 05:37, Sven-Hendrik Haase wrote:
On 26.08.2009 05:10, Aaron Griffin wrote:
On Tue, Aug 25, 2009 at 7:46 PM, Sven-Hendrik Haase<sh@lutzhaase.com> wrote:
On 25.08.2009 22:21, Nicolas Bigaouette wrote:
Would your script needs a shebang?
2009/8/25 Sven-Hendrik Haase <sh@lutzhaase.com>
On 25.08.2009 12:51, solsTiCe d'Hiver wrote:
> the crond log tells me that cron actually runs this command every > > > > minute without a problem i think you mis-read your log. and it should tell you that cron is looking for changes in /etc/cron.d every minute. may be, if you change you first * * * in your lol then may be it will work. assuming you're using the good cron. because fcron does not support /etc/cron.d but there is other ways to achieve the same thing.
check crond man page or its documentation
I'm using dcron and also I didn't misread. Also, dcron doesn't look for changes in said directory without restarting from what I have found out. It actually tells me what it is going to execute and that is my /etc/cron.d/lol file. It would report and error otherwise. The thing that strikes me is that the command doesn't actually do anything. echo is a shell built-in of sh, bash, any shell really so env vars shouldn't be an issue.
Any ideas?
No, stuff in /etc/cron.d/ looks just like stuff in your crontab and gets executed by the shell mentioned in $SHELL. Still, it wouldn't matter because I'm using a built-in here. I'm really baffled by this.
For the record, I've always had issues with this myself. I remedied it by simply putting things in root's crontab, but that's not a proper solution. If you can figure out how to get /etc/cron.d/ working as it should, I will love you forever
From web searches, it appears that dcron's support for /etc/cron.d is somewhat wacky and not guaranteed to work. I think having a look at bcron might be worth it. Find it here: http://untroubled.org/bcron/ and find the AUR package here: http://aur.archlinux.org/packages.php?ID=6841. A somewhat old assessment of available cron daemons by bcron's author can be found here: http://untroubled.org/bcron/old/bcron_1.html. Out of interest, I just looked up what other distros use for their cron system and surprise! Ubuntu and Debian both use bcron and /etc/cron.d works alright. I shall hereby request changing Arch's default cron daemon to bcron in order to fix the /etc/cron.d issues, to make Arch seem more modern and to make Aaron love me forever (whatever it is that will subsequently happen from that).
I'd like to bring this up again. Changing the cron daemon to a more modern one seems like a good idea to me.
On Mon, 07 Sep 2009, Sven-Hendrik Haase wrote:
On 26.08.2009 05:37, Sven-Hendrik Haase wrote:
On 26.08.2009 05:10, Aaron Griffin wrote:
On Tue, Aug 25, 2009 at 7:46 PM, Sven-Hendrik Haase<sh@lutzhaase.com> wrote:
On 25.08.2009 22:21, Nicolas Bigaouette wrote:
Would your script needs a shebang?
2009/8/25 Sven-Hendrik Haase <sh@lutzhaase.com>
On 25.08.2009 12:51, solsTiCe d'Hiver wrote:
>> the crond log tells me that cron actually runs this command every >> >> >> >> > minute without a problem > i think you mis-read your log. and it should tell you that cron is > looking for changes in /etc/cron.d every minute. > may be, if you change you first * * * in your lol then may be it will > work. > assuming you're using the good cron. because fcron does not > support /etc/cron.d but there is other ways to achieve the same thing. > > check crond man page or its documentation > > > > > > I'm using dcron and also I didn't misread. Also, dcron doesn't look for changes in said directory without restarting from what I have found out. It actually tells me what it is going to execute and that is my /etc/cron.d/lol file. It would report and error otherwise. The thing that strikes me is that the command doesn't actually do anything. echo is a shell built-in of sh, bash, any shell really so env vars shouldn't be an issue.
Any ideas?
No, stuff in /etc/cron.d/ looks just like stuff in your crontab and gets executed by the shell mentioned in $SHELL. Still, it wouldn't matter because I'm using a built-in here. I'm really baffled by this.
For the record, I've always had issues with this myself. I remedied it by simply putting things in root's crontab, but that's not a proper solution. If you can figure out how to get /etc/cron.d/ working as it should, I will love you forever
From web searches, it appears that dcron's support for /etc/cron.d is somewhat wacky and not guaranteed to work. I think having a look at bcron might be worth it. Find it here: http://untroubled.org/bcron/ and find the AUR package here: http://aur.archlinux.org/packages.php?ID=6841. A somewhat old assessment of available cron daemons by bcron's author can be found here: http://untroubled.org/bcron/old/bcron_1.html. Out of interest, I just looked up what other distros use for their cron system and surprise! Ubuntu and Debian both use bcron and /etc/cron.d works alright. I shall hereby request changing Arch's default cron daemon to bcron in order to fix the /etc/cron.d issues, to make Arch seem more modern and to make Aaron love me forever (whatever it is that will subsequently happen from that).
I'd like to bring this up again. Changing the cron daemon to a more modern one seems like a good idea to me.
What is the more modern one? -- Best, Jozsef Kurucity | Web & Graphic Designer +971 50 6783113 | jozefk@gmx.com
Hello together, this thread looks more as a contest who has the lowest percentage of own words or who has the highest percentage of qoutes.-)) If possible it would be nice (and more readable) to stop this 90/10 for qoutes/lines. If not, no problem, this is a free world and it is only a suggestion from mine. See you, Attila
participants (6)
-
Aaron Griffin
-
Attila
-
Jozsef
-
Nicolas Bigaouette
-
solsTiCe d'Hiver
-
Sven-Hendrik Haase