vixie-cron

Rating: 
5
Your rating: None Average: 5 (2 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.

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
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

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