Reply
 
Thread Tools Display Modes
  #1  
Old 06-07-2008, 11:20 PM
atrox atrox is offline
Member
 
Join Date: Jun 2007
Location: Estonia
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to atrox
Default configuring daily, weekly, monthly crontab
Hello.

I just thought that nowdays, when FreeBSD (and PC-BSD) ain't installed on servers only, computers running these systems may not be turned on all the time, so they will certainly miss (some of) the nightly-ran crontab jobs in this case. As some of them are quite important from usage point of view (eg. updating the locate database), this is not good

So it would be nice, if user could choose when to run these regular cron-jobs. Good alternatives for some specific time would be startup and shutdown - for an example, I really don't like getting in the middle of the nighlty cron jobs, especially if I'm playing some game but I wouldn't mind at all if the jobs ran after I choose to turn of my computer. So maybe somebody doesn't mind if the jobs run at startup..

The weekly and monthly jobs should then keep track on whether they should be ran too, ie. if it's the day for them to run or if it's more than week/month the last job ran.

I actually think this kind of setup would be very useful in desktop-linuxes too, but I don't know any distro that has it.. but well, I haven't searched for it yet either..

So what do you think about the idea?
Reply With Quote
  #2  
Old 06-08-2008, 03:37 AM
TerryP TerryP is offline
Senior Member
 
Join Date: Nov 2005
Location: Ga. USofA
Posts: 7,906
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to TerryP Send a message via AIM to TerryP Send a message via Yahoo to TerryP
Default Re: configuring daily, weekly, monthly crontab
Code:
Terry@dixie$ cat /usr/ports/sysutils/anacron/pkg-descr                     3:33
Anacron is a periodic command scheduler.  It executes commands at
intervals specified in days.  Unlike cron, it does not assume that the
system is running continuously.  It can therefore be used to control
the execution of daily, weekly and monthly jobs (or anything with a
period of n days), on systems that don't run 24 hours a day.

Anacron is not an attempt to make cron redundant.

Requirements
 - A functioning syslog daemon.
 - A functioning /usr/lib/sendmail command.  (all MTAs should have that).

WWW: http://sourceforge.net/projects/anacron
I think the PC-BSD developers said they were going to be using anacron in PC-BSD but I don't see it installed :\


disclaimer:

my cron jobs are always scheduled to run at opportune moments during usage or on a online 24/7 machine when I'm not likely around.
Reply With Quote
  #3  
Old 06-08-2008, 11:10 AM
atrox atrox is offline
Member
 
Join Date: Jun 2007
Location: Estonia
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to atrox
Default Re: configuring daily, weekly, monthly crontab
OK, so.. a system administrator can do it.. also can I achieve what I thought by commenting out the according lines in /etc/crontab and creating some quick script under /usr/local/etc/rc.d that would run all the jobs under /etc/periodic/daily when the script is ran with "stop" keyword (that's what happens at shutdown, right?).

But there's no GUI option for doing so (anacron doesn't have a GUI, does it?) and an ordinary user doesn't even know about such stuff. Also, if I take a look at my openSUSE, changing periodic jobs' schedule is not so trivial to me either as it's done in some weird shell script that is checked every 15 minutes. So these hacks ain't nice..

Also, Anacron seems to be out of development since 2000.
Reply With Quote
  #4  
Old 06-08-2008, 07:10 PM
TerryP TerryP is offline
Senior Member
 
Join Date: Nov 2005
Location: Ga. USofA
Posts: 7,906
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to TerryP Send a message via AIM to TerryP Send a message via Yahoo to TerryP
Default Re: configuring daily, weekly, monthly crontab
the etc/rc.d files are generally used for implementing services yes. The rc manual page also goes into details about doing the scripts so the start/stop thing works.

typically:

/etc/rc.d/ -> system services
/usr/local/etc/rc.d -> third party (i.e. from ports) and site local (custom) services
/usr/Programs/rc.d/ -> services installed via PBI

are searched for the scripts on PC-BSD. The /etc/defaults/defaults/rc.conf file sets the default directories to look in for the scripts (FreeBSD default of etc/rc.d on / and /usr/local). The directory names are not special, just pre-defined -> you can override the directories through /etc/rc.conf (or /etc/rc.conf.local if wished).



PC-BSD should come with kcron installed via the kdeadmin module of KDE3. It's a gui for cron, no clue if it can handle anacron which seems to have a few drawbacks of its own.


AFAIK most systems these days would be running Vixie/ISC cron, which probably hasn't had a major release in a few years but generally works as is supposed to (as an implementation of cron).
Reply With Quote
  #5  
Old 06-09-2008, 09:38 AM
atrox atrox is offline
Member
 
Join Date: Jun 2007
Location: Estonia
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to atrox
Default Re: configuring daily, weekly, monthly crontab
The point of the topic wasn't to discuss whether it's possible (as quite everything is possible), but whether it should be done very easily accessible and configurable for a standard user who hasn't even heard about cron jobs.

To my mind some GUI should ask the user/admin when to run these important tasks - ie. if the computer will be switched on 24/7 or not. If the question is put into a very friendly and understandable form, why not to ask it after installation
Reply With Quote
  #6  
Old 06-09-2008, 05:10 PM
TerryP TerryP is offline
Senior Member
 
Join Date: Nov 2005
Location: Ga. USofA
Posts: 7,906
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to TerryP Send a message via AIM to TerryP Send a message via Yahoo to TerryP
Default Re: configuring daily, weekly, monthly crontab
I believe anything within reason should be doable both via CLI and GUI methods.


Most non into-computers people I've met don't know much about scheduling tasks (or that it's possible in some cases), so personally I feel prompting the user to setup the run times for cronjobs as they are commonly referred to would be more likely to annoy or confuse people.


That's just my opinion. If you want to get to the develops, you should post on there mailing list because they don't follow the forums as closely.


kcron I'd assume is a decent tool for the task of adjusting things for those who want to adjust cronjobs. If necessary, someone could always fork kcron and port it to Anacron or write a better front end.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Your daily to-do list - Please act too! Charles The Lounge 30 05-07-2010 12:05 PM
Configuring a Linksys SDX Networking 1 04-04-2007 09:18 PM
Daily giggle Apatewna The Lounge 19 02-15-2007 05:09 AM
Configuring WI FI txwylde Installing PC-BSD 3 02-07-2006 07:16 PM
Configuring PF new2bsd General Questions 8 08-11-2005 03:35 AM


All times are GMT. The time now is 09:03 AM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

Copyright 2005-2010, The PC-BSD Project. PC-BSD and the PC-BSD logo are registered trademarks of iXsystems.
All other content is freely available for sharing under the terms of the Creative Commons Attribution License.