I can change ownership to the logged in user but that user has no write clearance so I need to sudo each command if it wants to write on disk, hence why it ended as root
see what happens when I run your command as user
node updatefiles
(node:12394) UnhandledPromiseRejectionWarning: Error: EACCES: permission denied, open '/home/wfarchive/version.json'
at Object.fs.openSync (fs.js:646:18)
at Object.fs.writeFileSync (fs.js:1299:33)
at writeV (/home/wfarchive/util.js:38:5)
at <anonymous>
(node:12394) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:12394) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
{ Error: EACCES: permission denied, open '/home/wfarchive/log/files.log'
errno: -13,
code: 'EACCES',
syscall: 'open',
path: '/home/wfarchive/log/files.log' }
all other scripts run normal n that server, librenms, unifi monitor etc, no issues at all and they also needed sudo to install. But from there on, smooth.
Your script is ok, it runs … hence why I used root crontab for the crons but seems not to run, let me run manually the update as root
nothing in terminal to see, did a pm2 restart all but soething broke according server.err
TypeError: /home/wfarchive/views/config.ejs:195
193| <div class="f_1"></div>
194| <div class="f_2"><label for="station_latitude">Latitude: </label></div>
>> 195| <div class="f_3"><input id="station_latitude" type="text" name="station_latitude" size="20" value="<%=configTemp.station.latitude%>"></div>
196| <div class="f_e"></div>
197| <div class="f_0"></div>
198| <div class="f_1"></div>
Cannot read property 'latitude' of undefined
at eval (eval at compile (/home/wfarchive/node_modules/ejs/lib/ejs.js:618:12), <anonymous>:175:44)
at returnedFn (/home/wfarchive/node_modules/ejs/lib/ejs.js:653:17)
at tryHandleCache (/home/wfarchive/node_modules/ejs/lib/ejs.js:251:36)
at View.exports.renderFile [as engine] (/home/wfarchive/node_modules/ejs/lib/ejs.js:482:10)
at View.render (/home/wfarchive/node_modules/express/lib/view.js:135:8)
at tryRender (/home/wfarchive/node_modules/express/lib/application.js:640:10)
at Function.render (/home/wfarchive/node_modules/express/lib/application.js:592:3)
at ServerResponse.render (/home/wfarchive/node_modules/express/lib/response.js:1008:7)
at /home/wfarchive/server.js:128:6
at Layer.handle [as handle_request] (/home/wfarchive/node_modules/express/lib/router/layer.js:95:5)
seems something new that needs config but the config tab gives above showed error
Give me an idea what date you are looking for and how you want it exported.
I am building an application for my use that lets a device request a webpage and get the current weather returned in JSON. I use it to control the irrigation system.
Thanks Gary.
I will be setting up another RPi with WF Py Console for someone else and was looking at WF Archive to get and store all the data. He asked if I could get the data moved from RPi to the PC for analysis and such. Perhaps this can be done already or maybe I could open and query the database stored on the RPi via Windows that would work too.