Skip to content

Commit

Permalink
* [Reference](#50 (comment))
Browse files Browse the repository at this point in the history
  • Loading branch information
tlindsay42 committed Jul 19, 2020
1 parent d8a6e8c commit da08321
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
14 changes: 13 additions & 1 deletion cron/msm
Expand Up @@ -2,7 +2,7 @@
# Minecraft Server Manager Cron
#
# Backs up worlds, rolls logs, moves worlds in RAM to disk,
# and starts crashed servers
# starts crashed servers, and deletes old archives
#
# For more information visit the project home page:
# https://github.com/msmhq/msm
Expand All @@ -20,3 +20,15 @@

# Start any crashed servers again each hour
@hourly minecraft /etc/init.d/msm start

# Deletes all server log files older than the number of days specified in the mtime parameter value
10 05 * * * minecraft find /opt/msm/servers/*/logs -maxdepth 1 -mtime +30 -type f -name "*.log.gz" | xargs rm --force

# Deletes all server backup files older than the number of days specified in the mtime parameter value
12 05 * * * minecraft find /opt/msm/archives/backups -maxdepth 2 -mtime +30 -type f -name "*.zip" | xargs rm --force

# Deletes all msm log files older than the number of days specified in the mtime parameter value
14 05 * * * minecraft find /opt/msm/archives/logs -maxdepth 2 -mtime +30 -type f -name "*.log.gz" | xargs rm --force

# Deletes all server world backup files older than the number of days specified in the mtime parameter value
16 05 * * * minecraft find /opt/msm/archives/worlds -maxdepth 3 -mtime +30 -type f -name "*.zip" | xargs rm --force
3 changes: 2 additions & 1 deletion installers/common.sh
Expand Up @@ -106,7 +106,8 @@ function patch_latest_files() {
# patch cron file
install_log "Patching MSM cron file"
sudo awk '{ if ($0 !~ /^#/) sub(/minecraft/, "'$msm_user'"); print }' \
"$dl_dir/msm.cron.orig" >"$dl_dir/msm.cron"
"$dl_dir/msm.cron.orig" | \
sed "s#/opt/msm#$msm_dir#g" >"$dl_dir/msm.cron"

# patch init file
install_log "Patching MSM init file"
Expand Down

0 comments on commit da08321

Please sign in to comment.