Sort out SuperTurtleIdle backups
This commit is contained in:
parent
d08967c511
commit
83ec5f1ec2
@ -10,6 +10,8 @@ downloaddir="${XDG_DOWNLOAD_DIR:-$HOME/Downloads}"
|
|||||||
documentsdir="${XDG_DOCUMENTS_DIR:-$HOME/Documents}"
|
documentsdir="${XDG_DOCUMENTS_DIR:-$HOME/Documents}"
|
||||||
picturesdir="${XDG_PICTURES_DIR:-$HOME/Pictures}"
|
picturesdir="${XDG_PICTURES_DIR:-$HOME/Pictures}"
|
||||||
videosdir="${XDG_VIDEOS_DIR:-$HOME/Videos}"
|
videosdir="${XDG_VIDEOS_DIR:-$HOME/Videos}"
|
||||||
|
# If we have Nextcloud installed, this will be our backups dir
|
||||||
|
backupsdir="${HOME}/Nextcloud/Backups"
|
||||||
|
|
||||||
# Take loose crap out of the home folder
|
# Take loose crap out of the home folder
|
||||||
echo "Sorting away videos from homedir..."
|
echo "Sorting away videos from homedir..."
|
||||||
@ -72,4 +74,16 @@ find "$HOME" \
|
|||||||
find "$downloaddir" \
|
find "$downloaddir" \
|
||||||
-mtime +30 -type f -iname "*.zip" \
|
-mtime +30 -type f -iname "*.zip" \
|
||||||
-print -delete
|
-print -delete
|
||||||
|
# Sort out Super Turtle Idle automatic backups
|
||||||
|
[ -d "$backupsdir" ] && {
|
||||||
|
echo "Sorting out turtle backups..."
|
||||||
|
mkdir -p "$backupsdir/SuperTurtleIdle"
|
||||||
|
for file in "$downloaddir"/SuperSaveData-*.json; do
|
||||||
|
if [ -e "$file" ]; then
|
||||||
|
lastmod="$(stat -c %y -- "$file")"
|
||||||
|
echo "Moving backup from $lastmod"
|
||||||
|
mv "$file" "$backupsdir/SuperTurtleIdle/SuperSaveData-$lastmod.json"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user