Answer the question
In order to leave comments, you need to log in
How to run node js server via ssh?
Hello
, I'm trying to make a script that deploys a node js file to the server, stops the current process and restarts the node file
#!/bin/bash
echo "деплоим index.js"
scp index.js [email protected]:~/tg_bot/
echo "остановка бота"
ssh [email protected] "pkill -f 'node index.js'"
echo "запуск бота"
ssh [email protected] "cd tg_bot && node index.js"
bash: node: command not found
Answer the question
In order to leave comments, you need to log in
ssh [email protected] "pkill -f 'node index.js'"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question