Update Scripts/mc-backup.sh
This commit is contained in:
parent
e77cb9afce
commit
6d3e1875f9
|
@ -64,8 +64,8 @@ for dir in *; do
|
||||||
# Delete all directories except for the most recent one
|
# Delete all directories except for the most recent one
|
||||||
if [[ ${dir} != ${dir_recent} ]]; then
|
if [[ ${dir} != ${dir_recent} ]]; then
|
||||||
|
|
||||||
# Check if directory is older than 1 day
|
# Check if directory is older than 12 hours
|
||||||
find ${dir} -maxdepth 0 -type d -mtime +1 -exec echo "Backup {} deleted." \; -exec rm -rf {} +
|
find ${dir} -maxdepth 0 -type d -mmin +720 -exec echo "Backup {} gelöscht." \; -exec rm -rf {} +
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
@ -73,9 +73,10 @@ done
|
||||||
##################################################
|
##################################################
|
||||||
|
|
||||||
## Delete Old Logs
|
## Delete Old Logs
|
||||||
|
find "/home/$user/.minecraft/" -name 'launcher_log*' -size +1G -mtime +1 -exec rm {} +
|
||||||
|
|
||||||
# Check if Minecraft and the launcher are not running
|
# Check if Minecraft and the launcher are not running
|
||||||
if ! pgrep -f "minecraft" > /dev/null; then
|
if ! pgrep -f "minecraft*.jar" > /dev/null && ! pgrep -f "minecraft-launcher" > /dev/null; then
|
||||||
|
|
||||||
# Delete official logs that are larger than 1 GB and older than 1 hour
|
# Delete official logs that are larger than 1 GB and older than 1 hour
|
||||||
find "/home/$user/.minecraft/" -name 'launcher_log*' -size +1G -mmin +60 -exec rm {} +
|
find "/home/$user/.minecraft/" -name 'launcher_log*' -size +1G -mmin +60 -exec rm {} +
|
||||||
|
@ -84,4 +85,4 @@ if ! pgrep -f "minecraft" > /dev/null; then
|
||||||
find "/home/$user/.minecraft/logs" -type f -mtime +30 -exec rm {} +
|
find "/home/$user/.minecraft/logs" -type f -mtime +30 -exec rm {} +
|
||||||
find "/home/$user/.minecraft/logs" -type f -empty -delete
|
find "/home/$user/.minecraft/logs" -type f -empty -delete
|
||||||
|
|
||||||
fi
|
fi
|
Loading…
Reference in New Issue