Search code examples
node.jsloggingforever

cleaning .forever logs in nodejs


I have a nodejs forever running service. Its creating logs of huge size and because of this i run out of space and server stops the service by throwing error "No space left on the device".

Size of .forever directory is 4.6 GB. I want to clean this.

My service is currently running therefore i want this shouldn't have any impact if i clean the logs.

Please find below the attached screen shot.

enter image description here

Any help is really appreciated.


Solution

  • Use forever cleanlogs

    OR

    You can use something like rm *.

    This will not delete any subdirectories or any file within them.

    Source

    P.S. and don't store logs inside your volume. If you still want to. Give it more space by attaching an EBS