]> Git — Sourcephile - julm/podcasts.git/blob - send-key.sh
send-redmi: do not send snapshots
[julm/podcasts.git] / send-key.sh
1 #!/usr/bin/env bash
2 # shellcheck disable=SC2064
3 set -eux
4
5 cd "${0%/*}"
6
7 dev=${1:-/dev/disk/by-uuid/1AEC-F13E}
8 mnt=$(mktemp -d)
9 if mountpoint "$dev"; then
10 mnt="$dev"
11 else
12 mkdir -p "$mnt"
13 sudo umount "$dev" || true
14 trap "sudo umount $mnt && rmdir $mnt && sync" EXIT
15 sudo mount -v -o uid="$USER",fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,showexec,utf8,flush "$dev" "$mnt"
16 fi
17
18 ./copy-new.sh
19
20 rsync -rv --remove-source-files \
21 --exclude "*.part" \
22 --exclude "*.aria2" \
23 --exclude "/audio/RadioFrance/LaSérieDocumentaire/*" \
24 --include "/audio/SmashingSecurity/2021-*" \
25 --exclude "/audio/SmashingSecurity/*" \
26 --include "/audio/NakedSecurity/2021-*" \
27 --exclude "/audio/NakedSecurity/*" \
28 --include "/audio/FOSSAndCrafts/2021-*" \
29 --exclude "/audio/FOSSAndCrafts/*" \
30 --exclude ".*" \
31 --no-inc-recursive --info=progress2 \
32 --size-only --inplace --partial --progress -i \
33 new/ \
34 "$mnt"/