mirror of
https://github.com/amigan/rustypaste-pretty.git
synced 2024-11-22 04:19:47 -05:00
docs(readme): apply shellcheck suggestions to cleanup script
This commit is contained in:
parent
44ab1318ee
commit
2d5c14a6e0
1 changed files with 3 additions and 4 deletions
|
@ -100,14 +100,13 @@ $ curl -F "oneshot=@x.txt" "<server_address>"
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Cleaning up expired files
|
#### Cleaning up expired files
|
||||||
Change `/path/to/rusty` to your rustypaste folder and put this script in the `cron`.
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
#!/bin/env sh
|
#!/bin/env sh
|
||||||
now=$(date +%s)
|
now=$(date +%s)
|
||||||
find /path/to/rusty/ -maxdepth 2 -type f -iname "*.[0-9]*" |
|
find upload/ -maxdepth 2 -type f -iname "*.[0-9]*" |
|
||||||
while read filename; do
|
while read -r filename; do
|
||||||
[ "$(( ${filename##*.} / 1000 - ${now} ))" -lt 0 ] && rm ${filename}
|
[ "$(( ${filename##*.} / 1000 - "${now}" ))" -lt 0 ] && rm -v "${filename}"
|
||||||
done
|
done
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue