vixie-cron

Rating: 
5
Your rating: None Average: 5 (3 votes)

Warning regarding SailfishOS upgrades:

to prevent any misbehavior of the cron daemon, please stop the daemon before starting any OS upgrade


 

Cron is a standard UNIX daemon that runs specified programs at scheduled times.
Paul Vixie's cron adds better security and more powerful configuration
options to the standard version of cron.

Vixie Cron has been adapted for Sailfish OS by Zeamoceq to prevent timer sleep issues.

Sources can e.g be found on github.

I uploaded this package in my repo as it is a dependency of Sailcron.

Please consider NOT using vixie-cron, but a maintained cron program: cronie

Keywords:

Application versions: 
AttachmentSizeDate
File vixie-cron-3.0pl1-1.armv7hl.rpm20.33 KB10/02/2016 - 23:10
File vixie-cron-3.0pl2-2.armv7hl.rpm20.76 KB22/02/2018 - 00:22
File vixie-cron-3.0pl2-2.i486.rpm26.34 KB18/02/2019 - 02:12
File vixie-cron-3.0pl2-2.aarch64.rpm32.46 KB15/06/2021 - 23:16
Changelog: 

User will now keep its secondary groups when running from cron, so for example some network permission problems on Xperia X should be solved (thanks @juiceme)

Comments

carmenfdezb's picture

Could you please add aarch64 package for Xperia 10 II? For some reason, cronie never worked on my Xperias

ade's picture

I do remember that weird problem. Sounds like the perfect opportunity to give cronie another chance on a this new device first?

carmenfdezb's picture

Yeah, I've already tried on my Xperia 10 II, but it doesn't work, cronie service is running but it doesn't run my script. However, the same script works on my Xperia XA2 with vixie-cron

ade's picture

Uploaded an attempt for an aarch64 build.

carmenfdezb's picture

Thank you so much!! I've installed vixie-cron, but I can't start service: not found cron.service unit file. This happens because cron.service is in '/lib/systemd/system/' instead of '/usr/lib/systemd/system/'. Atm I solved it with a symlink, but I get the next warning when I open harbour-sailcron: cron daemon is not running, however it's running

ade's picture

It's been a long time since I have looked at vixiecron.

About the warning that cron is not running: are you missing the procps-ng package?

pgrep -f /usr/sbin/crond

should give you a number (pid) of the running vixiecron process. If the result is empty or an error it will give that warning.

About the location of the service file: it is the same as for arm7hl and i486 package, and that worked in the past.

carmenfdezb's picture

Yep, pgrep command doesn't give any result.
I will use my Xperia XA2 for testing so I will try cronie there again. I hope I will find the reason that it doesn't work for me. Could you tell me what device you use? I would like to know if you use Xperias like me.

ade's picture

I am using a Xperia XA2 right now with cronie. But I am pretty sure it does not matter what device you are using.

If you say you have vixiecron running, the pgrep command should provide output. Does systemctl status or ps indicate crond is indeed running?
ps the 'cronie' cron process is named cron btw, not crond.

carmenfdezb's picture

systemctl status says that cron.service is running and my script worked with vixie-cron. It is very weird that cronie doesn't work on my phones

EDIT: Well, I've tried cronie again and it works!! I wasn't adding path variable correctly, that was the reason that it didn't work. Sorry for all and thank you for your help

ade's picture

Great that it is sorted out now!

ade's picture

It's a bit tricky to mount via cron. First of you do not have control over the exact moment it tries mounted, it could be too early. A more proper way would be using systemd's mount unitfiles, which has ordering/dependencies.
But if you want to use cron: if the mount happens too early, you could prestart your command with a "sleep 20" for example. And if you want to see what happend: add "> /tmp/mymount_result.txt 2>&1" to your line. You can inspect that file after reboot to see a possible error.

levone1's picture

I see...  So you're saying if it tries to mount, but it fails because of some other system startup issue, then that's all it will do, and it will never actually mount, so the 'sleep 20' refers to a 20-second wait, before it attempts to mount?  So I could really play it safe and just use 'sleep 60' or something...  Anyway, I guess the only reason I was even hung up on the @reboot is because it seemed like the best option for something like a folder mount, which you only have to do once per boot.  I could just as easily set it to do it every 15 minutes or every hour, and it wouldn't hurt anything, right?

...Which makes me wonder - if I schedule something to run every 15 minutes, does it attempt to do it at boot also, or wait until 15 minutes after?

 

Thanks

ade's picture

If you want to know what is going on, try to log to a file as I suggested. I would not use a repeating interval.

So try:


@reboot sleep 20;/usr/local/bin/yourscript.sh > /tmp/mymount_result.txt 2>&1

See if it get's mounted, otherwise check the file /tmp/mymount_result.txt for errors.

levone1's picture

sleep 30 worked. Mounted at boot... Thanks again

levone1's picture

New to cron - question... I have made a script to mount a local folder, (tested in terminal, and works). I put the script in /usr/local/bin/ and set permissions 0755. I installed a new cron job, with devel-su, (script uses --bind), to run the script at boot: "@reboot /usr/local/bin/(script).sh". Cron output shows job installed, no error, but folder is not mounted on reboot.  Also tried with script in /home/nemo.

Also, anything I've read on cron indicates a config-type file in /etc, but I have no cron files anywhere in /etc.  There's one similar file in /lib/systemd...  but has different info...  What am I missing?

Thanks