diff options
| -rw-r--r-- | ar/.config/shell/aliasrc | 4 | ||||
| -rwxr-xr-x | ar/.local/bin/ylog | 21 |
2 files changed, 22 insertions, 3 deletions
diff --git a/ar/.config/shell/aliasrc b/ar/.config/shell/aliasrc index 7d8d62e..04ee2ce 100644 --- a/ar/.config/shell/aliasrc +++ b/ar/.config/shell/aliasrc @@ -511,7 +511,7 @@ alias ylogr='ylog -s recordings -c us | grep $(LC_TIME=C date +%d/%b) | grep -E alias ylogR='ylog -s recordings -c us | grep $(LC_TIME=C date -d "1 days ago" +%d/%b) | grep -E "[0-9]{2}:[0-9]{2}:[0-9]{2} "' alias ylogT='ylog -s recordings -c us | grep $(LC_TIME=C date -d "2 days ago" +%d/%b) | grep -E "[0-9]{2}:[0-9]{2}:[0-9]{2} "' alias ylogu='ylog -s diary -c us' -alias ylogv='ylog -s recordings -c us | grep $(LC_TIME=C date +%d/%b) | grep -E "[0-9]{2}:[0-9]{2}:[0-9]{2} "' -alias ylogV='ylog -s recordings -c us | grep $(LC_TIME=C date -d "1 days ago" +%d/%b) | grep -E "[0-9]{2}:[0-9]{2}:[0-9]{2} "' +alias ylogv='ylog -s videos -c us | grep $(LC_TIME=C date +%d/%b) | grep -E "[0-9]{2}:[0-9]{2}:[0-9]{2} "' +alias ylogV='ylog -s videos -c us | grep $(LC_TIME=C date -d "1 days ago" +%d/%b) | grep -E "[0-9]{2}:[0-9]{2}:[0-9]{2} "' alias yloga='ylogd; ylogr; ylogp; ylogv' alias ylogA='ylogD; ylogR; ylogP; ylogV' diff --git a/ar/.local/bin/ylog b/ar/.local/bin/ylog index 8ea8808..89f4715 100755 --- a/ar/.local/bin/ylog +++ b/ar/.local/bin/ylog @@ -28,13 +28,14 @@ Options: us : recordings.us.log + recordings.access.log (and diary.us.log when -s diary) -s SCOPE Select log scope (default: all) - all : recordings + access + hidden + diary + peertube + all : recordings + access + hidden + diary + peertube + videos access : access.* logs only diary : diary.* logs only hidden : hidden.access.* logs only media : media.access.* logs only peertube : peertube.* logs only recordings : recordings.* logs only + videos : videos.* logs only -n Disable Firefox exclusion (by default, Firefox lines are excluded) @@ -58,6 +59,7 @@ Examples: ylog -s media # Media logs only, last 10 lines each ylog -s peertube # Peertube logs only, last 10 lines each ylog -s recordings # Recordings logs only, last 10 lines each + ylog -s videos # Videos logs only, last 10 lines each ylog -c kr -t 1.2.3.4 # Search specific IP in Korean logs ylog -c kr -s diary # Korean diary logs only ylog -t all -l 50 # All logs, last 50 lines each @@ -178,6 +180,23 @@ pick_files() { ;; esac fi + # videos logs: similar structure to recordings + if [ "$SCOPE" = "videos" ] || [ "$SCOPE" = "all" ]; then + if [ "$COUNTRY" = "all" ]; then + for q in "$LOG_DIR/videos.access.log" "$LOG_DIR/videos.access.log".*; do + [ -e "$q" ] && printf "%s\n" "$q" + done + fi + case "$COUNTRY" in + kr) for q in "$LOG_DIR/videos.kr.log" "$LOG_DIR/videos.kr.log".*; do [ -e "$q" ] && printf "%s\n" "$q"; done ;; + us) for q in "$LOG_DIR/videos.us.log" "$LOG_DIR/videos.us.log".*; do [ -e "$q" ] && printf "%s\n" "$q"; done ;; + all) + for p in videos.kr.log videos.us.log; do + for q in "$LOG_DIR/$p" "$LOG_DIR/$p".*; do [ -e "$q" ] && printf "%s\n" "$q"; done + done + ;; + esac + fi } # build exclude regex |
