I
I
ikerya2017-05-19 17:08:22
Node.js
ikerya, 2017-05-19 17:08:22

nohup. Why doesn't writing to a file with fwrite work?

Hello. Can you please tell me why writing to a file does not work when calling a file through nohup (nohup forever start /var/www/sitename/server.js)?

fs.readFile(this.filename, "utf-8", (err, data) => {
    let new_content = `${data}\n${text}`;

    fs.writeFile(this.filename, new_content);
  });

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Anton, 2017-05-19
@Fragster

switch to pm2

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question