Skip to content

Commit

Permalink
misc - yet another fix to importer scripts (logs cleanup)
Browse files Browse the repository at this point in the history
  • Loading branch information
edoshor committed Aug 8, 2018
1 parent b769fdb commit 2f6697c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion misc/import_blogs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ LOG_FILE="$BASE_DIR/logs/blogs/import_$TIMESTAMP.log"

cd ${BASE_DIR} && ./mdb blog-latest > ${LOG_FILE} 2>&1

find "${BASE_DIR}/logs/blogs" -type f -mtime +7 -exec rm -rf {} \;

WARNINGS="$(egrep -c "level=(warning|error)" ${LOG_FILE})"

if [ "$WARNINGS" = 0 ];then
Expand All @@ -18,4 +20,3 @@ fi

echo "Errors in periodic import of blogs to MDB" | mail -s "ERROR: MDB blogs import" -r "mdb@bbdomain.org" -a ${LOG_FILE} edoshor@gmail.com

find "${BASE_DIR}/logs/blogs" -type f -mtime +7 -exec rm -rf {} \;
3 changes: 2 additions & 1 deletion misc/import_storage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ LOG_FILE="$BASE_DIR/logs/storage/import_$TIMESTAMP.log"

cd ${BASE_DIR} && ./mdb storage > ${LOG_FILE} 2>&1

find "${BASE_DIR}/logs/storage" -type f -mtime +7 -exec rm -rf {} \;

WARNINGS="$(egrep -c "level=(warning|error)" ${LOG_FILE})"

if [ "$WARNINGS" = 0 ];then
Expand All @@ -18,4 +20,3 @@ fi

echo "Errors in periodic import of storage catalog to MDB" | mail -s "ERROR: MDB storage import" -r "mdb@bbdomain.org" -a ${LOG_FILE} edoshor@gmail.com

find "${BASE_DIR}/logs/storage" -type f -mtime +7 -exec rm -rf {} \;
3 changes: 2 additions & 1 deletion misc/import_twitter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ LOG_FILE="$BASE_DIR/logs/twitter/import_$TIMESTAMP.log"

cd ${BASE_DIR} && ./mdb twitter-latest > ${LOG_FILE} 2>&1

find "${BASE_DIR}/logs/twitter" -type f -mtime +7 -exec rm -rf {} \;

WARNINGS="$(egrep -c "level=(warning|error)" ${LOG_FILE})"

if [ "$WARNINGS" = 0 ];then
Expand All @@ -18,4 +20,3 @@ fi

echo "Errors in periodic import of twitter to MDB" | mail -s "ERROR: MDB twitter import" -r "mdb@bbdomain.org" -a ${LOG_FILE} edoshor@gmail.com

find "${BASE_DIR}/logs/twitter" -type f -mtime +7 -exec rm -rf {} \;

0 comments on commit 2f6697c

Please sign in to comment.