Skip to content

Commit 6399882

Browse files
authored
Merge pull request #38 from clowder-framework/clean_extractors_tmpfiles
Clean extractors tmpfiles
2 parents e945148 + 1f8b25b commit 6399882

File tree

4 files changed

+22
-1
lines changed

4 files changed

+22
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77
## Unreleased
88

99
### Added
10-
- Error queue cleanup script
10+
- Script to clean extractors' tmp files.
11+
- Script for RabbitMQ error queue cleanup.
1112

1213
## 1.10.1 - 2020-07-16
1314

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 list.txt /
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=list.txt
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)