改成用pm2管理hexo了,再也不用 cd ~/blog/hexo && hexo clean && hexo g && pkill -f hexo && nohup hexo s -p 8097 了
1. npm install -g pm2
2. nano run_hexo.js
在~/blog/hexo下
内容为:
const { exec } = require('child_process');
exec('hexo server -p 8097', (err, stdout, stderr) => {
if (err) {
console.error(err);
return;
}
console.log(stdout);
});
3. pm2 start run_hexo.js --name "hexo-blog"
4. hexo clean && hexo g












