Search code examples
shellloggingsshusbpm2

Save pm2 logs to USB with ssh script


I have ssh script (auto run from usb) to export logs to usb once it plugged in. Have no problems with all other logs. But how to export pm2 logs?

Also it's nice to rotate logs on the usb.


Solution

  • To export pm2 logs, copy the file ~/.pm2/pm2.log