scripts/hugin-gopro-fusion/remove_pto_batch.sh

28 lines
857 B
Bash
Raw Normal View History

2024-02-12 10:29:58 +01:00
#!/bin/bash
# déplacer en masse des photos assemblées dans le dossier /home/poule/encrypted/stockage-syncable/photos/imageries/gopro/A_ORIENTER
# Argument validation
if [ "$#" -ne 2 ]; then
echo "Usage: $0 <start_number> <end_number>"
exit 1
fi
start_num="$1"
end_num="$2"
2024-02-12 10:41:44 +01:00
src_base_name="merging_"
2024-02-12 10:29:58 +01:00
# Déplacer des fichiers depuis le répertoire actuel vers le nouveau dossier
for i in $(seq -f "%03g" ${start_num} ${end_num}); do
2024-02-12 10:41:44 +01:00
src_file="${src_base_name}${i}.pto"
2024-02-12 10:29:58 +01:00
2024-02-12 10:41:44 +01:00
if [ -f "/home/poule/encrypted/stockage-syncable/photos/imageries/gopro/INBOX_PTO_hugin/${src_file}" ]; then
rm -rf "/home/poule/encrypted/stockage-syncable/photos/imageries/gopro/INBOX_PTO_hugin/${src_file}"
count=$((count+1))
2024-02-12 10:29:58 +01:00
else
echo "Fichier '${src_file}' introuvable."
fi
done
2024-02-12 10:41:44 +01:00
echo "Nombre de fichiers PTO supprimés : ${count}"