pull: make it per user
authorJulien Moutinho <julm@sourcephile.fr>
Mon, 6 Mar 2023 22:12:20 +0000 (23:12 +0100)
committerJulien Moutinho <julm@sourcephile.fr>
Mon, 6 Mar 2023 22:12:20 +0000 (23:12 +0100)
julm/pull.sh [moved from pull.sh with 93% similarity]
monique/pull.sh [new file with mode: 0755]
sevy/pull.sh [new file with mode: 0755]

similarity index 93%
rename from pull.sh
rename to julm/pull.sh
index ea84f3f5dea86c639ff917bf059d8d1e8ddf324f..5c3977524a72df0fa5e00cf57333ddeadee3e0b4 100755 (executable)
--- a/pull.sh
@@ -6,6 +6,7 @@ gio mount -l | grep mtp://"$host" ||
 gio mount mtp://"$host"/"Carte SD SanDisk"/
 
 year=$(date +%Y)
+
 mkdir -p "$year"/audio/src
 rsync -ai --no-inc-recursive --info=progress2 --inplace --partial \
   --remove-source-files \
@@ -17,7 +18,8 @@ mkdir -p "$year"/src
 for month in {01..12};  do
   rsync -ai --no-inc-recursive --info=progress2 --inplace --partial \
     --remove-source-files \
-    --include "???_$year$month*" --exclude '*' \
+    --include "???_$year$month*" \
+    --exclude '*' \
     /run/user/"$(id -u)"/gvfs/mtp:host="$host"/"Espace de stockage interne partagé"/DCIM/Camera/ \
     /run/user/"$(id -u)"/gvfs/mtp:host="$host"/"Carte SD SanDisk"/DCIM/Camera/ \
     "$year"/src/"$month"
diff --git a/monique/pull.sh b/monique/pull.sh
new file mode 100755 (executable)
index 0000000..0237462
--- /dev/null
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+host=Fairphone_FP3_A209PB4N0202
+cd "${0%/*}"
+set -eux
+gio mount -l | grep mtp://"$host" ||
+gio mount mtp://"$host"/CARTE_SD/
+
+year=$(date +%Y)
+
+mkdir -p "$year"/src
+for month in {01..12}
+do
+  rsync -ai --no-inc-recursive --info=progress2 --inplace --partial \
+    --include "???_2023${month}*" \
+    --exclude '*' \
+    /run/user/1000/gvfs/mtp:host="$host"/CARTE_SD/DCIM/Camera/ \
+    "$year"/src/"$month"
+done
diff --git a/sevy/pull.sh b/sevy/pull.sh
new file mode 100755 (executable)
index 0000000..1779025
--- /dev/null
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+host=Xiaomi_SDM439-QRD__SN%3AE77E9453_c645cda90006
+cd "${0%/*}"
+set -eux
+gio mount -l | grep mtp://"$host" ||
+gio mount mtp://"$host"/"Carte SD SanDisk"/
+
+year=$(date +%Y)
+
+# FIXME: handle previous year on new year
+mkdir -p "$year"/src
+for month in {01..12};  do
+  rsync -ai --no-inc-recursive --info=progress2 --inplace --partial \
+    --include "???_$year$month*" --exclude '*' \
+    /run/user/"$(id -u)"/gvfs/mtp:host="$host"/"Espace de stockage interne partagé"/DCIM/Camera/ \
+    /run/user/"$(id -u)"/gvfs/mtp:host="$host"/"Carte SD SanDisk"/DCIM/Camera/ \
+    "$year"/src/"$month"
+done