Skip to content
This repository has been archived by the owner on Feb 19, 2021. It is now read-only.

CosmiCloud/OTSysUpdate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OTSysUpdate

This will help you set up a cronjob that will trigger a script at 4am every Sunday that runs system updates on your node's VPS instance.

If the node is updating or bidding on a job, the update will be delayed for another week and the node will not be stopped.

A @reboot cronjob is used to initiate node start up on reboot after the update is finished. You will receive a Push notification whenever the script completes or fails. If the script does fail, the notification will include log statements to identify the issue.

Install the 'Notify My Device' app from the app store and install it onto your mobile device.

Navigate to https://www.notifymydevice.com/ and create an account. Go to 'My applications' and create an application. Copy the API key and save it for later.


On your node:
Install npm, nodejs

  • sudo apt install npm
  • sudo apt install nodejs

Edit your environment variables inside of your directory and add your API key and change your node name.

  1. Sudo nano .env
  2. Paste and edit the variables below

APIKEY=myapikey
NODENAME="my node name"

Add 2 cronjobs to the bottom of your crontab. 1 to trigger the script and the other to start the OTNode after reboot. Test running the commands before adding it to your crontab.

  1. Sudo nano /etc/crontab
  2. Edit and Paste the commands below to the end of your crontab

0 4 * * 0 root cd ~/path/to/my/script && node update.js
@reboot root cd ~/path/to/my/script && node startNode.js

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published