Skip to content

007revad/Synology_Cleanup_Coredumps

Repository files navigation

Synology Cleanup Coredumps

Donate committers.top badge

Description

Cleanup memory core dumps from crashed processes

Whenever a process crashes or restarts unexpectedly DSM creates a memory dump of the memory the process was using for debugging. Unless you intend debugging why the process crashed you don't need to keep them.

If you schedule the script to run in Task Scheduler with Send run details by email and Send run details only when the script terminates abnormally task scheduler will send you an email whenever the script deletes core dump files.

I found 92 coredump files (300MB), dating back to 2021 and DSM 6, on volume 1 of my Synology

Output of the script

Download the script

  1. Download the latest version Source code (zip) from https://github.com/007revad/Synology_Cleanup_Coredumps/releases
  2. Save the download zip file to a folder on the Synology.
  3. Unzip the zip file.

Scheduling the script in Synology's Task Scheduler

See How to schedule a script in Synology Task Scheduler

Running the script via SSH

How to enable SSH and login to DSM via SSH

You run the script in a shell with sudo -s or as root.

sudo -s /volume1/scripts/syno_clean_coredumps.sh

Note: Replace /volume1/scripts/ with the path to where the script is located.

Options:

The script has an to set the age in days so that only coredumps older than that age are deleted.

You can use -a or --age followed by a space then the number of days.

sudo -s /volume1/scripts/syno_clean_coredumps.sh -a 7
sudo -s /volume1/scripts/syno_clean_coredumps.sh --age 7

Note: Replace /volume1/scripts/ with the path to where the script is located.