]> Git — Sourcephile - julm/camera.git/blob - pull.sh
index: fix sorting of the src files
[julm/camera.git] / pull.sh
1 #!/usr/bin/env bash
2 host=Xiaomi_SDM439-QRD__SN%3AB0796589_c7565cf60006
3 cd "${0%/*}"
4 set -eux
5 gio mount -l | grep mtp://"$host" ||
6 gio mount mtp://"$host"/"Carte SD SanDisk"/
7
8 year=$(date +%Y)
9 mkdir -p "$year"/audio/src
10 rsync -ai --no-inc-recursive --info=progress2 --inplace --partial \
11 --remove-source-files \
12 /run/user/"$(id -u)"/gvfs/mtp:host="$host"/"Espace de stockage interne partagé"/MIUI/sound_recorder \
13 "$year"/audio/src/
14
15 # FIXME: handle previous year on new year
16 mkdir -p "$year"/src
17 for month in {01..12}; do
18 rsync -ai --no-inc-recursive --info=progress2 --inplace --partial \
19 --remove-source-files \
20 --include "???_$year$month*" --exclude '*' \
21 /run/user/"$(id -u)"/gvfs/mtp:host="$host"/"Espace de stockage interne partagé"/DCIM/Camera/ \
22 /run/user/"$(id -u)"/gvfs/mtp:host="$host"/"Carte SD SanDisk"/DCIM/Camera/ \
23 "$year"/src/"$month"
24 done