mirror of
https://github.com/amigan/rustypaste-pretty.git
synced 2024-11-21 11:59:48 -05:00
docs(readme): add shell script for cleaning files (#20)
This commit is contained in:
parent
d3a9e0c69d
commit
44ab1318ee
1 changed files with 7 additions and 1 deletions
|
@ -100,9 +100,15 @@ $ curl -F "oneshot=@x.txt" "<server_address>"
|
|||
```
|
||||
|
||||
#### Cleaning up expired files
|
||||
Change `/path/to/rusty` to your rustypaste folder and put this script in the `cron`.
|
||||
|
||||
```sh
|
||||
$ find upload/ -maxdepth 2 -type f -iname "*.[0-9]*" -exec rm -v {} \;
|
||||
#!/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}
|
||||
done
|
||||
```
|
||||
|
||||
#### URL shortening
|
||||
|
|
Loading…
Reference in a new issue