help
help copied to clipboard
how do I send var number to ps process list ubuntu in node.js with spawn with options?
Details
how do I send var number to ps process list Ubuntu in node.js with spawn?
I have a var number for example : NUMBER_X : 12345
I want that send number to process in list ps process ubuntu My code is this:
const rclone = require("rclone.js");
const task = new Promise((resolve, reject) => {
const subprocess = rclone.copy(source, dest, {
"env":{
...process.env,
NUMBER_X:1234
},
detached: true,
stdio: 'ignore',
'use-json-log': true,
transfers: 100,
'log-level' : 'INFO',
'max-backlog': 999999,
stats: '500ms'
});
subprocess.unref();
});
task.then((code) => {
code === 0 ? console.log("complete") : null;
});
I want when type:
ps -ef | grep rclone
Then I want to see NUMBER_X
in list process Ubuntu
Node.js version
15
Example code
No response
Operating system
ubuntu
Scope
spawn child process
Module and version
Not applicable.