Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 72 lines (65 sloc) 2.211 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
#!/bin/sh

mount=$(mount|grep SANSA|awk '{print $3}')

if [ $(mount | grep -c $mount) -gt 0 ]; then
    find $mount/PODCASTS/ -type f -name '*.pdf' -exec rm -v {} \;
    find $mount/PODCASTS/ -type f -name '*.mp4' -exec rm -v {} \;
    find $mount/PODCASTS/ -type f -name '*Apache_Tears*' -exec rm -v {} \;
    origdir=`pwd`

    if test -d /home/avar/Podcasts/Science/Science_Talk; then
        cd /home/avar/Podcasts/Science/Science_Talk
        rename 's/(?<!\.mp3)$/.mp3/' *
    fi

    cd $mount/PODCASTS/
    if test $? -ne 0
    then
        echo "Can't cd to PODCASTS"
        exit 1
    fi

    rsync \
        -av \
        --size-only \
        --progress \
        --exclude='*.log' \
        --exclude='*German*' \
        --exclude='*Show_[12]*' \
        --exclude='*Ostfront*' \
        --exclude='*Apache*' \
        --exclude='*.pdf' \
        --exclude='*.mp4' \
        --exclude='*Linguistics*' \
        --exclude='*.mp3-*' \
        --exclude='*Skeptics_Guide_Special_Report_H1N1_Update*' \
        --exclude='*The_Universe_[23456789]?_*' \
        --exclude='*The_Universe_1??_*' \
        --exclude='*Skeptics_Guide_1??_*' \
        --exclude='*Skeptics_Guide_2[01234]?_*' \
        --exclude='*Skeptics_Guide_24[01234]_*' \
        --exclude='*Astronomy_Cast*Mysteries_of_the_Solar_System*' \
        --exclude='*Astronomy_Cast*Mysteries_of_the_Milky_Way*' \
        --exclude='*Are_We_Alone*' \
        --exclude='*Science_Talk*' \
        --exclude='*Stuff_You_Missed_in_History*' \
        --exclude='*Skeptoid*' \
        --exclude='*Hacking/*' \
        --exclude='*News/*' \
        --exclude='*Wikipedia*' \
        --exclude='*Naked*' \
        --exclude='*Geologic*' \
        --exclude='*Ep._121*' \
        --exclude='*Ep._14[67]*' \
        --exclude='*Ep._168*' \
        --exclude='*Ep._170*' \
        --exclude='*Ep._7[0167]*' \
        --exclude='*Episode_26*' \
        --exclude='*Episode_28*' \
        /home/avar/Podcasts/ \
        --delete \
        .

    if test -d /home/avar/Podcasts/Science/Science_Talk; then
        cd /home/avar/Podcasts/Science/Science_Talk
        rename 's/\.mp3$//' *
    fi

    cd $origdir
else
    echo "$mount/ isn't mounted"
fi
Something went wrong with that request. Please try again.