mktar: Use `wc` instead of `du` in summary message
[sunny256-utils.git] / mobilstripp
blob5003788365b1aa6c8596a9afa34f4918dfb157b1
1 #!/usr/bin/env bash
3 #=======================================================================
4 # mobilstripp
5 # File ID: 81a4b5e0-cb0b-11e3-8632-000df06acc56
7 # Strip irrelevant stuff from nf list of mobile files
9 # Author: Øyvind A. Holm <sunny@sunbase.org>
10 # License: GNU General Public License version 2 or later.
11 #=======================================================================
13 progname=mobilstripp
14 VERSION=0.3.4
16 ARGS="$(getopt -o "\
20 " -l "\
21 help,\
22 quiet,\
23 verbose,\
24 version,\
25 " -n "$progname" -- "$@")"
26 test "$?" = "0" || exit 1
27 eval set -- "$ARGS"
29 opt_help=0
30 opt_quiet=0
31 opt_verbose=0
32 while :; do
33 case "$1" in
34 -h|--help) opt_help=1; shift ;;
35 -q|--quiet) opt_quiet=$(($opt_quiet + 1)); shift ;;
36 -v|--verbose) opt_verbose=$(($opt_verbose + 1)); shift ;;
37 --version) echo $progname $VERSION; exit 0 ;;
38 --) shift; break ;;
39 *) echo $progname: Internal error >&2; exit 1 ;;
40 esac
41 done
42 opt_verbose=$(($opt_verbose - $opt_quiet))
44 if test "$opt_help" = "1"; then
45 test $opt_verbose -gt 0 && { echo; echo $progname $VERSION; }
46 cat <<END
48 Strip irrelevant stuff from nf list of mobile files
50 Usage: $progname [options]
52 Options:
54 -h, --help
55 Show this help.
56 -q, --quiet
57 Be more quiet. Can be repeated to increase silence.
58 -v, --verbose
59 Increase level of verbosity. Can be repeated.
60 --version
61 Print version information.
63 END
64 exit 0
67 grep -i -E -e '\.(flac|gz|jpeg|jpg|m4a|mp3|mp4|pdf|pgn|png|wav)' \
68 -e /SMSBackupRestore/ | \
69 grep -v \
70 -e /Actionmemo/ \
71 -e /Android/data/cgeo\\.geocaching/files/GeocacheData/ \
72 -e /Android/data/com\\.amazon\\.kindle/files/appexpan/ \
73 -e /Android/data/com\\.andrewshu\\.android\\.redditdonation/cache/prefetch/ \
74 -e /Android/data/com\\.bambuna\\.podcastaddict/files/podcast/ \
75 -e /Android/data/com\\.dropbox\\.android/cache/ \
76 -e /Android/data/com\\.dropbox\\.android/cache/thumbs/ \
77 -e /Android/data/com\\.dropbox\\.android/files/scratch/ \
78 -e /Android/data/com\\.duolingo/cache/ \
79 -e /Android/data/com\\.evernote/files/announcements/ \
80 -e /Android/data/com\\.google\\.android\\.apps\\.docs/files/pinned_docs_files_do_not_edit/ \
81 -e /Android/data/com\\.google\\.android\\.apps\\.maps/testdata/voice/ \
82 -e /Android/data/com\\.google\\.android\\.gms/files/ \
83 -e /Android/data/com\\.google\\.earth/cache/ \
84 -e /Android/data/com\\.google\\.vr\\.cyclops/files/samples/ \
85 -e /Android/data/com\\.gopro\\.smarty/cache/ \
86 -e /Android/data/com\\.handmark\\.tweetcaster/cache/ \
87 -e /Android/data/com\\.nianticproject\\.ingress/cache/ \
88 -e /Android/data/com\\.rovio\\.angrybirdsspace\\.ads/cache/sessions/ \
89 -e /Android/data/com\\.samsung\\.android\\.app\\.episodes/cache/thumbnail \
90 -e /Android/data/com\\.samsung\\.android\\.app\\.episodes/files/album/ \
91 -e /Android/data/com\\.samsung\\.android\\.snote/cache/sstream_cache/ \
92 -e /Android/data/com\\.sec\\.android\\.app\\.FlashBarService/files/Pictures/ \
93 -e /Android/data/com\\.sec\\.android\\.app\\.sbrowser/TabManager/ \
94 -e /Android/data/com\\.sec\\.android\\.app\\.sbrowser/files/Pictures/com\\.sec\\.android\\.app\\.sbrowser/TabManager/ \
95 -e /Android/data/com\\.sec\\.android\\.app\\.shealth/cache/ \
96 -e /Android/data/com\\.sec\\.everglades/Files/icons/ \
97 -e /Android/data/com\\.touchtype\\.swiftkey/files/ \
98 -e /Android/data/com\\.tripadvisor\\.tripadvisor/files/MapResources/ \
99 -e /Android/data/com\\.vlingo\\.midas/serial/ \
100 -e /Android/data/dentex\\.youtube\\.downloader/files/cache/ \
101 -e /Android/data/org\\.telegram\\.messenger/cache/ \
102 -e /Android/data/org\\.videolan\\.vlc/cache/art/ \
103 -e /Android/data/org\\.videolan\\.vlc/files/thumbs/ \
104 -e /Android/data/reddit\\.news/cache/ \
105 -e /AnkiDroid/collection\\.media/ \
106 -e /BeyondPod/Podcasts/ \
107 -e /Camera360/TempData/ \
108 -e /Camera360/www/demo/ \
109 -e /Camera360/www/images/ \
110 -e /Camera360/www/scene/ \
111 -e /Camera360/www/skin/ \
112 -e /DCIM/\\.thumbnails/ \
113 -e /DoggCatcher/EpisodeEnclosures/ \
114 -e /DoggCatcher/PodcastImages/ \
115 -e /QrDroid/tmp/ \
116 -e /UnityAdsVideoCache/ \
117 -e /\\.ActionMemo/ \
118 -e /\\.cgeo/ \
119 -e /\\.samsungvideohub/cache/ \
120 -e /annex/mobile/ \
121 -e /extSdCard/Android/data/com\\.bambuna\\.podcastaddict/files/podcast/ \
122 -e /foursquare/cache/ \
123 -e /foursquare/category_cache/ \
124 -e /foursquare/photo_cache/ \
125 -e /tel/ \
126 -e \\./Telegram/ \
127 -e \\.pcg\$ \
128 -e ☠_her_har_vi_slutten | less