From 241ed1411796d972afceb26b072fae4d0268d3a8 Mon Sep 17 00:00:00 2001 From: HF Date: Wed, 2 Jun 2021 21:11:23 +0200 Subject: [PATCH] fix last commit --- src/routes/api/history.js | 2 +- src/ui/ChunkLoader2D.js | 2 +- utils/backupSync.sh | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/routes/api/history.js b/src/routes/api/history.js index 9d423adc..0ff2801c 100644 --- a/src/routes/api/history.js +++ b/src/routes/api/history.js @@ -16,7 +16,7 @@ async function history(req: Request, res: Response) { res.status(404).end(); } const yyyy = day.slice(0, 4); - const mm = day.slice(4, 2); + const mm = day.slice(4, 6); const dd = day.slice(6); const path = `${BACKUP_DIR}/${yyyy}/${mm}/${dd}/${id}`; diff --git a/src/ui/ChunkLoader2D.js b/src/ui/ChunkLoader2D.js index 93a20e41..52ef4ffa 100644 --- a/src/ui/ChunkLoader2D.js +++ b/src/ui/ChunkLoader2D.js @@ -255,7 +255,7 @@ class ChunkLoader { const center = [historicalCanvasMaxTiledZoom, cx, cy]; // eslint-disable-next-line max-len - let url = `${window.ssv.backupurl}/${historicalDate.slice(0, 4)}/${historicalDate.slice(4, 2)}/${historicalDate.slice(6)}/`; + let url = `${window.ssv.backupurl}/${historicalDate.slice(0, 4)}/${historicalDate.slice(4, 6)}/${historicalDate.slice(6)}/`; if (historicalTime) { // incremential tiles url += `${canvasId}/${historicalTime}/${cx}/${cy}.png`; diff --git a/utils/backupSync.sh b/utils/backupSync.sh index 6b30c711..9edc90ab 100644 --- a/utils/backupSync.sh +++ b/utils/backupSync.sh @@ -7,11 +7,10 @@ DATE_YESTERDAY=`printf "%(%Y/%m/%d)T" $(( $(printf "%(%s)T" -1) - 24*3600 ))` #delete older daily backup folders from local filesystem if exist if [ -d "${TMPDIR}/${DATE_YESTERDAY}" ] then + echo "Deleting past day from tmp-folder ${DATE_YESTERDAY}" rm -rf "${TMPDIR}/${DATE_YESTERDAY}" fi -exit - rsync -r ${TMPDIR}/ backup@ayylmao:/backup/pixelplanet/canvas #clear current daily folder