CronJob - Where to Identify / crontab -e Does not work


#1

Dear Devs,

Can you please advise how to add a cronjob to HiveOS ? crontab -e command to edit the tasks does not work since it pulls the file from TMP location.

Thanks for the advices


#2

for permanent changes edit file /hive/etc/crontab.root


#3

thx !


#4

but it is deleted when you restart


#5

Tried editing using:
root@hiverig:/hive/etc# crontab.root -e
and get:
bash: ./crontab.root: Permission denied

I’m able to edit using vi and nano, but nothing happens when added the following commands to end of the file (just trying to stop on 1st minute and start on 4th for testing):
#stop miner
1 * * * * /hive/bin/miner stop

#start miner
4 * * * * /hive/bin/miner start

Thank you for your help!


#6

You must be thinking that editting /hive/etc/crontab.root is the same as running the command sudo crontab -e to edit the crontab are the same. I have confirmed that on my system, if you use sudo crontab -e, your changes will be lost at reboot, but if you add your changes to /hive/etc/crontab.root, any changes made will saved in remain in the crontab after reboot.


#7

Indeed, I am total hive noob. Thought editing crontab.root with nano or vim is same as with -e?

If I use command, /hive/etc/crontab.root -e

Returns, bash: ./crontab.root: Permission denied


#8

Were you able to edit with nano? ‘nano crontab.root’ is the command when in the /hive/etc/ directory.


#9

Yes, was able to edit the file using nano crontab.root but this did not work.

It has been a while, will try process again this weekend and update.