Skip to content

Commit 8fa9986

Browse files
committed
adding cleanup job for removing cache
1 parent 556cdf6 commit 8fa9986

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

scripts/cleanup.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
3+
PYCACHE=__pycache__
4+
MY_HOME=/c/Users/Ibrahim/Desktop
5+
SHOW_FINDING=`find . -type d -name "${PYCACHE}" 2>/dev/null`
6+
TIMESTAMP=`date '+%F %T'`
7+
8+
for RESULT in "${SHOW_FINDING}"; do
9+
echo "#############################"
10+
echo "Result found: $RESULT"
11+
echo "#############################"
12+
done
13+
14+
cd $MY_HOME
15+
16+
if [ -z "${SHOW_FINDING}" ]; then
17+
echo "${TIMESTAMP} INFO No ${PYCACHE} found."
18+
exit 2
19+
else
20+
find . -type d -name "${PYCACHE}" -exec rm -rf {} +
21+
echo "${TIMESTAMP} INFO Cleanup is completed."
22+
exit 0
23+
fi
24+
25+
sleep 5
26+

0 commit comments

Comments
 (0)