You are not logged in.
Cronwhip is a small script that can run missed cronjobs at startup. See the info page for more details:
http://xyne.archlinux.ca/projects/cronwhip
Last edited by Xyne (2012-08-23 23:39:59)
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
Have you contributed anything that I haven't found useful?
Offline
Have you contributed anything that I haven't found useful?
I've uploaded it to the AUR now.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
Pretty nice! I've silently wished for something like this a couple of times in the past...
EDIT: the PKGBUILD in AUR depends on aria2 for some reason... cleanup?
Last edited by bender02 (2008-10-30 23:14:38)
Offline
EDIT: the PKGBUILD in AUR depends on aria2 for some reason... cleanup?
Ooops, sorry about that. I copied the PKGBUILD from powerpill and forgot to remove the dep. It's fixed now.
Thanks for letting me know.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
Doesn't this something do like Anacron (http://anacron.sourceforge.net)?
Last edited by CuleX (2008-10-31 10:48:43)
Offline
Doesn't this something do like Anacron (http://anacron.sourceforge.net)?
The OP specifically talks about this in his post:
Unlike anacron and others (as I've understood it), you do NOT need to give cronwhip its own tasklist. It parses crontab directly to find out what cron should have done.
Last edited by foutrelis (2008-10-31 11:06:34)
Offline
bender02 wrote:EDIT: the PKGBUILD in AUR depends on aria2 for some reason... cleanup?
Ooops, sorry about that. I copied the PKGBUILD from powerpill and forgot to remove the dep. It's fixed now.
Thanks for letting me know.
It seems that the dependency is not the only thing you forgot to edit, check the package description:
A wrapper for pacman that speeds up package retrieval by using aria2c for concurrent/segmented downloads.
Useless to say, I was completely puzzled before reading all the posts
Have you Syued today?
Free music for free people! | Earthlings
"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery
Offline
*hangs head in shame*
Thanks finferflu. It's fixed now.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
Ah, by the way, I forgot to say thank you for this handy script!
Have you Syued today?
Free music for free people! | Earthlings
"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery
Offline
Is there any advantage to using dcron + cronwhip rather than fcron?
Offline
Is there any advantage to using dcron + cronwhip rather than fcron?
I don't know because I'm not familiar with fcron. It probably depends on what you need your cron daemon to do. Use whatever works for you.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
I'm getting
Argument "@reboot" isn't numeric in numeric eq (==) at /usr/bin/cronwhip line 112.
Offline
I've added support for @reboot, @yearly, etc.
Try the latest version (>=2.0.1) and let me know if it resolves the issue.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
Hey Xyne. Thanks for your contributions, I greatly enjoy reflector and have tried powerpill in the past.
I would like to put cronwhip in my DAEMONS-array in rc.conf. Should I:
1) replace cron with cronwhip?
2) or start cron before/after cronwhip?
Cheers,
M
Offline
Hey Xyne. Thanks for your contributions, I greatly enjoy reflector and have tried powerpill in the past.
I would like to put cronwhip in my DAEMONS-array in rc.conf. Should I:
1) replace cron with cronwhip?
2) or start cron before/after cronwhip?Cheers,
M
Hi mariusmeyer,
Cronwhip isn't a daemon and it cannot replace cron. It should only be run once shortly after booting to run any cronjobs that would have been run since the last system shutdown. I recommend that you simply add the following line to /etc/rc.local to have it run missed cronjobs 5 minutes after startup:
(sleep 300 && /usr/bin/cronwhip) &
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
Oh, I see. Thanks for the explanation!
Offline
@Xyne:
Am i going to give you taco's ?? YES
/me hands Xyne some taco's
This is really a good idea because normally i make a backup every day at six o'clock but if i am a day out or the pc isn't on it doesnt backup so this script will fix that !
Offline
@mariusmeyer
np
@jelly
WOOOOOOOT, TACOS!
*gladly munches away while wondering how long it will take cactus to show up*
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
This looks like a nice 'arch way' script. One question though. The manpage says:
Cronwhip runs cronjobs that would have been run in the time since the last system shutdown
Does this also include missed cronjobs because of suspending to ram/disk? If so it would be clearer to add it to the package description and manpage. And I assume I need to put it somewhere else than /etc/rc.local if I want it to run at waking from suspend right?
Last edited by rwd (2009-08-13 19:13:36)
Offline
I use the output of "last -x" to get the shutdown time. If that contains output for waking from suspend then I can update cronwhip to recognize that. I would need an example of the output though.
I don't know what the best way would be to run it when waking from suspend. I think I've seen scripts on the forum for waking events though, so you might find something relevant with a few forum searches.
Btw, using the output of "last -x" was the best (read: simplest and most universal) solution that I found at the time of writing cronwhip. I haven't looked into improving it since then because it works flawlessly here, but if there is a better way then I would consider implementing it.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
working now good after the update ty
(sleep 300 && /usr/bin/cronwhip) &
maybe a comment after compiling about adding this to '/etc/rc.local' ?
Offline
Good idea. I've added a post_install message.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
I made a VERY hacky way to get this working with suspend/resume at lunch (20 minutes, no promises:P). I would not really recommend this, but it is stable after a few reboots/suspends/hibernates for me at the moment. All I do is make a pm-suspend action that dumps the time (date +%s) into a file on suspend/hibernate and runs a very-slightly-modified cronwhip on resume/thaw. If you actually try this code you should take note that the second file is redirecting cronwhip's verbose output to ~/.cronwhip.
changes to cronwhip file
54a55
> my $last_suspend = `cat /var/log/whendidisuspend.log`;
60a62,65
> my ($slast) = ($last_suspend =~ m/(\d+)/);
> if ($slast > $last) {
> $last = $slast
> }
/etc/pm/sleep.d/99cronwhip:
#!/bin/bash
case "$1" in
hibernate|suspend)
echo $(date +%s) > /var/log/whendidisuspend.log
;;
resume|thaw)
/usr/local/bin/cronwhip -v >> /home/me/.cronwhip
;;
*)
exit $NA
;;
esac
exit $?
EDIT:
Oh and I don't really know perl or anything about pm-utils, heheh.
Last edited by drostin77 (2009-12-17 07:23:07)
Offline
If I set a daily cron job and left the computer turned off for a week then when I turned it back on would the cron job run 7 times?
Linux is not an operating system it's a kernel. You're using GNU/Linux. http://www.gnu.org/gnu/linux-and-gnu.html
Offline