Skip to content
Snippets Groups Projects
Commit 71095ac0 authored by Jörg Sachse's avatar Jörg Sachse
Browse files

feat: add alias to run SubApp and print logs for that action (thx Jens)

parent c389c1ba
No related branches found
No related tags found
No related merge requests found
......@@ -48,3 +48,4 @@
alias list_quarantine_full='for sip in $(ls -t ~/.subapp/quarantine); do echo -e "$sip# ($( stat -c %y ~/.subapp/quarantine/$sip/sip.ERROR ))# => $(cat ~/.subapp/quarantine/$sip/sip.ERROR)\n===\n"; done | column -s "#" -t'
alias quarantine_summary='echo -e "$( ls ~/.subapp/quarantine/ | wc -l ) SIPs in quarantine.\n"; for sip in $(ls -t ~/.subapp/quarantine/); do echo "$( du -sh /mnt/import/${sip} ),# $( stat -c %y ~/.subapp/quarantine/$sip/sip.ERROR ),# $( find /mnt/import/${sip}/ -type f | wc -l) files"; done | column -s "#" -t'
alias quarantine_size='sum=0; for dir in $(find ~/.subapp/quarantine/ -name "sip.bagit"); do if [[ -d $(realpath ${dir}) ]]; then sum=$((sum+$(du -s $(realpath ${dir}) | cut -f1))); else echo "broken Q-Link: ${dir}"; fi; done; echo "$((sum/1024)) MiB in quarantine."'
alias next='/usr/bin/perl -I /usr/local/perl/ /usr/local/bin/subapp_bagit.pl --config-file /home/processing/.subapp/subapp.cfg --single_run; echo "################# LOG #####################"; echo "last 10 lines..."; tail -n 10 /var/log/subapp/${HOSTNAME}/sips.log; echo "################# PROBLEMS #####################"; START=$( grep -n "starting..." /var/log/subapp/${HOSTNAME}/subapp.log | tail -1 | cut -f1 -d: ); ALL_LINES=$( wc -l < /var/log/subapp/${HOSTNAME}/subapp.log ); let LINES=$ALL_LINES-$START; echo "checking last $LINES log lines..."; tail -n $LINES /var/log/subapp/${HOSTNAME}/subapp.log | grep --color -e "\[ERROR\]" -e "\[FATAL\]" -e "\[WARN\]"'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment