Skip to content

Commit

Permalink
Update syno_clean_coredumps.sh
Browse files Browse the repository at this point in the history
- Changed to delete non .gz core dumps as well.
  • Loading branch information
007revad authored Jul 30, 2023
1 parent cc9ba6c commit 29fbca2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions syno_clean_coredumps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,16 @@ for volume in /volume*; do
if [[ $age =~ [0-9]+ ]]; then
# Delete core dumps older than $age
echo "Deleting core dumps older than $age days on ${volume}"
find "$volume"/@*.core.gz -mtime +"$age" -delete
find "$volume"/@*.core* -mtime +"$age" -delete
else
# Delete all core dumps
echo "Deleting all core dumps on ${volume}"
find "$volume"/@*.core.gz -delete
find "$volume"/@*.core* -delete
fi

# Inform of recent core dumps (those newer than $age)
for coredumps in "$volume"/@*.core.gz; do
#for coredumps in "$volume"/@*.core.gz; do
for coredumps in "$volume"/@*.core*; do
if [[ $new != yes ]]; then
echo -e "\nRecent core dumps less than $age days old:" && new=yes
fi
Expand All @@ -51,3 +52,4 @@ if [[ $new == yes ]]; then
exit 1
fi


0 comments on commit 29fbca2

Please sign in to comment.