-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpack_new_model.sh
executable file
·21 lines (20 loc) · 1002 Bytes
/
pack_new_model.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env bash
RECENT_TEXTS=$(find /media/diego/QData/techarticles/pickle/ -name "texts_*.p" -mmin -240 | wc -l)
if [ $RECENT_TEXTS -gt 0 ]; then
cd ~/projects/newscollection/
find /media/diego/QData/techarticles/models/doc2vec -mmin +240 -type d | xargs rm -f -r
find /media/diego/QData/techarticles/models/lsi -mmin +240 -type d | xargs rm -f -r
find /media/diego/QData/techarticles/models/phrases -mmin +240 -type d | xargs rm -f -r
rm /media/diego/QData/techarticles/pickle/bigrams*
rm /media/diego/QData/techarticles/pickle/trigrams*
find /media/diego/QData/techarticles/pickle/ -name "texts_*.p" -mmin +240 | xargs -n1 rm
mkdir -p /media/diego/QData/techarticles/version
echo $(git log -n1 --pretty='%h') > /media/diego/QData/techarticles/version/model_version.txt
rm /media/diego/QData/techarticles.tgz
pushd /media/diego/QData/
tar cvfz techarticles.tgz techarticles
popd
else
echo "No Recent model exists - Exiting"
exit 1
fi