]> Git — Sourcephile - julm/podcasts.git/blob - send-key.sh
handle more extensions
[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 "*.part-Frag*" \
23 --exclude "*.aria2" \
24 --exclude ".*" \
25 --no-inc-recursive --info=progress2 \
26 --size-only --inplace --partial --progress -i \
27 new/ \
28 "$mnt"/