I installed Cronie, but having a problem using it. I’d like to use it to reboot the computer every day at a certain hour. Anyway, running crontab -e in Terminal, I get this:
Welcome to the Haiku shell.
~> crontab -e no crontab for user - using an empty one /bin/sh: line 1: /usr/bin/vi: No such file or directory crontab: “/usr/bin/vi” exited with status 127 ~>
I think the error is related to cronie trying to use Linux’s Vi text editor, which doesn’t exist in Haiku. I can manually create and edit a crontab file, but I don’t know where to create it. Can anyone assist? Thanks
Vim is largely vi compatible, mostly extending the features. Given that cronie most likely only wants to open a temporary crontab file with it it don’t expect any compatibility issues. But that’s only guessing, the OP will have to try it out. And if it works maybe vim should be included in the dependencies for cronie.
Thanks for letting me know
Let’s not get into nitpicking wars on Easter Sunday, shall we? As I wrote above, cronie most likely wants to call vi to simply open the crontab file. I don`t expect any vi vs. vim compatibility issues doing that.
The missing editor doesn´t seem to be the only problem with cronie. I have vim installed and get these errors:
~> crontab -e
/packages/cronie-1.5.2-2/.self/var/spool/cron: No such file or directory
/packages/cronie-1.5.2-2/.self/var/spool/cron: mkdir: No such file or directory
Looks like cronie wants to create the crontab file within the package itself, which obviously doesn´t work. This is not surprising because looking at the haikuports recipe there is no patch applied that does anything to point cronie at the right spool directories on Haiku (or at least I didn´t find any).
I think we really should have an integrated task scheduler on Haiku that can be configured via GUI to avoid having users messing around with cron-like programs. Sure, a having a task scheduler is probably not a high priority on a desktop OS but very useful sometimes nonetheless.
@kp3ft : There was a discussion about something similar on the forum a while ago, where a script was posted that runs in a loop and mimics the behaviour of a simple task scheduler. Maybe this could be a workaround for you for the time being.
Yeah, that was probably one of my previous posts. I need the Haiku computer to reboot at a particular time every very early morning. Some folks posted some scripts to try, but I couldn’t get them to work.
It works! I did export EDITOR=nano and then crontab -e . Added a reboot statement in the crontab file and saved it. Computer rebooted right on schedule.
What worked for me to get Cronie working:
Install Cronie from the package manager.
2.Run in Terminal: mkdir -p /boot/system/var/spool/cron ln -sv /bin/crond ~/config/settings/boot/launch/crond
Reboot (might not be necessary, but I rebooted anyway.)
It probably should exist. It’s one of the BeAPI find_directory constants(B_SYSTEM_SPOOL_DIRECTORY). Then there would be no need to modify the cronie code.