From 2d5c14a6e0f48ae4bffbd573a773e5fb840377f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Orhun=20Parmaks=C4=B1z?= Date: Thu, 17 Mar 2022 11:45:05 +0300 Subject: [PATCH] docs(readme): apply shellcheck suggestions to cleanup script --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 71a9a22..3d0c506 100644 --- a/README.md +++ b/README.md @@ -100,14 +100,13 @@ $ curl -F "oneshot=@x.txt" "" ``` #### Cleaning up expired files -Change `/path/to/rusty` to your rustypaste folder and put this script in the `cron`. ```sh #!/bin/env sh now=$(date +%s) -find /path/to/rusty/ -maxdepth 2 -type f -iname "*.[0-9]*" | -while read filename; do - [ "$(( ${filename##*.} / 1000 - ${now} ))" -lt 0 ] && rm ${filename} +find upload/ -maxdepth 2 -type f -iname "*.[0-9]*" | +while read -r filename; do + [ "$(( ${filename##*.} / 1000 - "${now}" ))" -lt 0 ] && rm -v "${filename}" done ```