Skip to content

Commit be50807

Browse files
committed
scripts to clean extractors' tmp files
1 parent c7d83b1 commit be50807

File tree

4 files changed

+25
-0
lines changed

4 files changed

+25
-0
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

7+
## Unreleased
8+
9+
### Added
10+
- script to clean extractors' tmp files.
11+
712
## 1.10.1 - 2020-07-16
813

914
### Fixed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM alpine
2+
3+
COPY clean.sh /
4+
5+
CMD ["sh", "/clean.sh"]
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
LIST=$1
4+
5+
while IFS=, read -r path days;
6+
do
7+
case "$path" in \#*) continue ;; esac
8+
echo "path: $path", "days: $days"
9+
deleted=$(/usr/bin/find $path -maxdepth 1 -mindepth 1 -mtime +$days)
10+
echo $deleted
11+
rm -rf $deleted
12+
echo "deletion done"
13+
done < "$LIST"
14+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#path,days

0 commit comments

Comments
 (0)