Skip to content

Commit 01ac50b

Browse files
authored
Note on local storage cleanup
1 parent ee9acae commit 01ac50b

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,25 @@ docker build -t transfersh .
7373
docker run --publish 8080:8080 --rm transfersh --provider local --basedir /tmp/
7474
```
7575

76+
## Cleanup local straoge
77+
78+
```
79+
#!/bin/bash
80+
VOLUME="/var/tmp"
81+
FILES=$(find $VOLUME -type f -name *.expires)
82+
TIMESTAMP=$(date '+%s')
83+
84+
for file in $FILES
85+
do
86+
expires=$(head -1 $file)
87+
if [[ $expires -lt $TIMESTAMP ]]
88+
then
89+
rm -rf "$(echo $file | cut -d'.' -f1)"
90+
rm $file
91+
fi
92+
done
93+
```
94+
7695
## Contributions
7796

7897
Contributions are welcome.

0 commit comments

Comments
 (0)