This is a discussion on Question about cron.daily/hourly and son. within the Slackware Linux Support forums, part of the Unix Operating Systems category; --> I got a small question about cron jobs. I put a small script in /etc/cron.daily, makes it executable, it ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I got a small question about cron jobs. I put a small script in /etc/cron.daily, makes it executable, it runs everyday at 0702 just as it should. After reading and looking around I see that this is not the way to do it? I've done it this way for several years and it has always worked. Am I totally wrong on this? Do I really have to use crontab for everything? Micke -- # The truth lies in there, # # somewhere in the manual. # |
| |||
| micke <micke_spam_@_remove_gullarp_this_to.com> wrote: >I got a small question about cron jobs. >I put a small script in /etc/cron.daily, makes it executable, it runs >everyday at 0702 just as it should. After reading and looking around I see >that this is not the way to do it? I've done it this way for several years >and it has always worked. Am I totally wrong on this? Do I really have to >use crontab for everything? > >Micke Yes, you must use crontab for everything... and indeed, you *are*! Just indirectly, that's all. And that is fine. Your crontab executes /etc/cron.daily at 0702 every day, and anything you want to have done at that time, in that sequence, can just be added to the cron.daily script. For example, if you want something run once a week, you /could/ put it in cron.daily and code it to only run on Mondays. It would seem to be much better to put that directly into crontab though, eh? -- FloydL. Davidson <http://web.newsguy.com/floyd_davidson> Ukpeagvik (Barrow, Alaska) floyd@barrow.com |
| |||
| Floyd L. Davidson wrote: > Yes, you must use crontab for everything... and indeed, you *are*! > > Just indirectly, that's all. And that is fine. Your crontab executes > /etc/cron.daily at 0702 every day, and anything you want to have done > at that time, in that sequence, can just be added to the cron.daily > script. > > For example, if you want something run once a week, you /could/ > put it in cron.daily and code it to only run on Mondays. It > would seem to be much better to put that directly into crontab > though, eh? > If I would need something done specific days in the week or month then it's natural to use crontab, yes I agree and yes crontab is involved all the time as you say inderectly. Thank you for your reply, I was getting a bit confused since I do my backup on the server every morning at 0702 and that seems to be working for a few years without problem, and then all the sudden I hear, no rather read, that it has to be setup with crontab to work and not only put in to /etc/cron.daily. But I continue my way even after upgrading to 10.0 on my server I'll see if continue working. Thanks a lot! Micke -- # The truth lies in there, # # somewhere in the manual. # |
| |||
| On 2004-09-25, micke <micke_spam_@_remove_gullarp_this_to.com> wrote: > I got a small question about cron jobs. > I put a small script in /etc/cron.daily, makes it executable, it runs > everyday at 0702 just as it should. After reading and looking around I see > that this is not the way to do it? I've done it this way for several years > and it has always worked. Am I totally wrong on this? Do I really have to > use crontab for everything? No, you don't need to crontab for everything. You just use crontab for those cases where you want to do something differently. |
| |||
| On Saturday 25 September 2004 06:44 am, william.hamblen@earthlink.net did deign to grace us with the following: > On 2004-09-25, micke <micke_spam_@_remove_gullarp_this_to.com> wrote: > >> I got a small question about cron jobs. >> I put a small script in /etc/cron.daily, makes it executable, it runs >> everyday at 0702 just as it should. After reading and looking around I >> see that this is not the way to do it? I've done it this way for several >> years and it has always worked. Am I totally wrong on this? Do I really >> have to use crontab for everything? > > No, you don't need to crontab for everything. You just use crontab > for those cases where you want to do something differently. Well, I've just read man crontab, and I still have no idea how it works. It's kinda like reading KA's exposition of memes. I do have this stuff, which the only person who I can think of who might have put it there would be Mr Volkerding, by script: rich@entheos:~ $ ls /etc/cron.daily logrotate* slocate* rich@entheos:~ $ ls /etc/cron.hourly kmod* rich@entheos:~ $ ls /etc/cron.monthly rich@entheos:~ $ ls /etc/cron.weekly rich@entheos:~ $ locate crontab /usr/doc/ntp-4.2.0/scripts/support/etc/crontab /usr/man/man1/crontab.1.gz /usr/X11R6/include/X11/bitmaps/crontab.xbm /usr/X11R6/include/X11/pixmaps/crontab.xpm /usr/share/vim/vim63/syntax/crontab.vim rich@entheos:~ $ So I'd be tempted to just plunk a a script down in one of those $DIRs. I'm pretty sure I need to learn how to do this for NTP, but I need to read more about that too. Cheers! Rich |
| |||
| Rich Grise wrote: > Well, I've just read man crontab, and I still have no idea how it works. do as root 'crontab -l' and all will be revealed. > It's kinda like reading KA's exposition of memes. who's KA? > So I'd be tempted to just plunk a a script down in one of those $DIRs. no offence, but if you intend to do sysadmining, you'd better know how this stuff works exactly. otherwise, it'll come back and bite you some day. -- Joost Kremers joostkremers@yahoo.com Selbst in die Unterwelt dringt durch Spalten Licht EN:SiS(9) |
| |||
| On Saturday 25 September 2004 04:30 pm, Joost Kremers did deign to grace us with the following: > Rich Grise wrote: >> Well, I've just read man crontab, and I still have no idea how it works. > > do as root 'crontab -l' and all will be revealed. > >> It's kinda like reading KA's exposition of memes. > > who's KA? > >> So I'd be tempted to just plunk a a script down in one of those $DIRs. > > no offence, but if you intend to do sysadmining, you'd better know how > this stuff works exactly. otherwise, it'll come back and bite you some > day. > No offense taken. :-) Like I said, I'm "tempted," but thankfully I still have this little bubble of sanity left in my headbone that stops me from doing really dangerously stupid stuff, mostly. ;-) Thanks! Rich |
| |||
| Rich Grise wrote: >SNIP > > So I'd be tempted to just plunk a a script down in one of those $DIRs. > I'm pretty sure I need to learn how to do this for NTP, but I need to read > more about that too. > > Cheers! > Rich Well it's not hard to understand infact as suggested crontab -l gives information that is very easy to get (even for me), I started this thread with the simple reason that sonetimes you would like to do things the simple way (I prefer that) and not put up new cron-jobs on diffrent times but use what is already done. Like in the /etc/cron.hourly things are done at one specific time x number of minutes after full hour. My thoughts was that since I have already set up the times for those jobs ones and didn't want to do it once again since the time of day is important. Don't want to disturbe the network with doing maintenance on working hours but at one time per day before people start working and use the same time for all those daily jobs (backup, logrotate and so on). I prefer to put the scripts in the cron.daily and it will be done at the correct time. Without having to change anything with crontab. This works in Slack 7 8 9 and 10 I wasn't sure about then thats the reason for asking BEFORE I upgrade to 10 on the servers. Thanks all for your replies! Micke -- # The truth lies in there, # # somewhere in the manual. # |
| |||
| >>I got a small question about cron jobs. >>I put a small script in /etc/cron.daily, makes it executable, it runs >>everyday at 0702 just as it should. After reading and looking around I see >>that this is not the way to do it? I've done it this way for several years >>and it has always worked. Am I totally wrong on this? Do I really have to >>use crontab for everything? > Yes, you must use crontab for everything... and indeed, you *are*! > > Just indirectly, that's all. And that is fine. Your crontab executes > /etc/cron.daily at 0702 every day, and anything you want to have done > at that time, in that sequence, can just be added to the cron.daily > script. > > For example, if you want something run once a week, you /could/ > put it in cron.daily and code it to only run on Mondays. It > would seem to be much better to put that directly into crontab > though, eh? What I miss in Slacware is an /etc/crontab file, with the possibility to specfy as which user the job gets executed. Some other distro's have that feature. Like this for ex.: 15 0 * * * root /root/bin/bekap.sh 16 0 * * * apache /var/www/scripts/rebuild.sh -- дамјан If Bill Gates had a dime for every time a Windows box crashed... ...Oh, wait a minute, he already does. |
| ||||
| ?????? ??????????? wrote: >>>I got a small question about cron jobs. >>>I put a small script in /etc/cron.daily, makes it executable, it runs >>>everyday at 0702 just as it should. After reading and looking around I see >>>that this is not the way to do it? I've done it this way for several years >>>and it has always worked. Am I totally wrong on this? Do I really have to >>>use crontab for everything? > >> Yes, you must use crontab for everything... and indeed, you *are*! >> >> Just indirectly, that's all. And that is fine. Your crontab executes >> /etc/cron.daily at 0702 every day, and anything you want to have done >> at that time, in that sequence, can just be added to the cron.daily >> script. >> >> For example, if you want something run once a week, you /could/ >> put it in cron.daily and code it to only run on Mondays. It >> would seem to be much better to put that directly into crontab >> though, eh? > > What I miss in Slacware is an /etc/crontab file, with the possibility to > specfy as which user the job gets executed. Some other distro's have that > feature. > > Like this for ex.: > 15 0 * * * root /root/bin/bekap.sh > 16 0 * * * apache /var/www/scripts/rebuild.sh > > -- Joost Kremers joostkremers@yahoo.com Selbst in die Unterwelt dringt durch Spalten Licht EN:SiS(9) |
| Thread Tools | |
| Display Modes | |
|
|