photo_du_mois.sh

minor corrections
This commit is contained in:
2025-11-28 09:31:25 +01:00
parent 839d05bfbb
commit dbb36fae15

View File

@@ -97,15 +97,18 @@ echo -e "├─┘├─┤│ │ │ │ │ │││ │ ││││
echo -e "┴ ┴ ┴└─┘ ┴ └─┘─────┴┘└─┘────┴ ┴└─┘┴└─┘o└─┘┴ ┴"
echo
echo -e "\n${bold}0. Verify last uploads on remote servers ${reset}\n"
echo -e "\n${bold}0. Verify last uploads on remote servers (for info.)...${reset}\n"
last_remote_files
echo -e "\n${bold}1. From Lightroom Classic, export ${italic}collection 'Photo du mois'${reset}${bold} => $SRC${reset}\n"
echo -e "Done ! <Press Enter>"
read -r -p ""
# 2. Rename 2025-11-04_ChardonneretElegant_0747 to 11_2025.jpg
echo -e "\n${bold}2. Renaming Photos files...${reset}"
for FILE in "${SRC}"/**/*.{jpg,jpeg}
@@ -113,6 +116,7 @@ do
filename=$(basename "$FILE")
#extension=${filename##*.}
filename=${filename%.*}
if [[ $filename =~ $REGEX ]]; then
MATCH="${BASH_REMATCH[0]}"
y=$(echo "${MATCH}" | awk -F"-" '{print $1}')
@@ -129,9 +133,11 @@ do
done
# 3. If new images -> copy them to server
if [ "${#movies[@]}" -gt 0 ]; then
echo -e "\n${bold}${#movies[@]} new images found !${reset}\n"
for ((i=0 ; i<"${#server[@]}" ; i++))
do
j=$((i++))
@@ -150,6 +156,7 @@ if [ "${#movies[@]}" -gt 0 ]; then
scp -O -P "${port[$i]}" "$new" "${user[$i]}"@"${server[$i]}":"${dest[$i]}"
else
scp -P "${port[$i]}" "$new" "${user[$i]}"@"${server[$i]}":"${dest[$i]}"
# scp -P 22 1_2022.jpg funnymac@ftp.cluster011.ovh.net:www/zenphoto/albums/photos-du-mois/
fi
result=$?
[ "$result" -eq 0 ] && echo -e "${green}Successful transfert...${reset}\n" || echo -e "${red}Error during transfert !${reset}\n"
@@ -162,19 +169,12 @@ if [ "${#movies[@]}" -gt 0 ]; then
done
else
echo -e "\n${bold}${red}No new images !${reset}"
#echo -e "${bold}Quit.${reset}\n"
#exit
echo -e "\n${bold}${red}3. No new images to transfer!${reset}"
fi
for ((i=0 ; i<"${#server[@]}" ; i++))
do
# scp 5_2022_mozcjpeg.jpg sentier@sur-le-sentier.fr:httpdocs/photos/img/
# scp 1_2022.jpg funnymac@ftp.cluster011.ovh.net:www/zenphoto/albums/photos-du-mois/
echo -e "\n\n${bold}4. Synchronise Local folder to ${server[$i]}${reset}..."
@@ -184,16 +184,16 @@ do
rsync -e "/usr/bin/ssh -p ${port[$i]}" --rsync-path=/bin/rsync --exclude-from="$HOME/.exclude-rsync.txt" -zarvh --stats --progress "$SRC/" "${user[$i]}"@"${server[$i]}":"${dest[$i]}"
else
rsync --exclude-from="$HOME/.exclude-rsync.txt" -zarvh --stats --progress "$SRC/" "${user[$i]}"@"${server[$i]}":"${dest[$i]}"
# rsync --exclude-from="$HOME/.exclude-rsync.txt" -zarvh --stats --progress "$HOME/Sites/_sls/photos/img" funnymac@ftp.cluster011.ovh.net:www/zenphoto/albums/photos-du-mois/
fi
result=$?
[ "$result" -eq 0 ] && echo -e "\n${green}Successful synchronization...${reset}" || echo -e "\n${red}Error during synchronization !${reset}"
#notification "MkDocs: sending Docs to ${server3[server]}..." "${server3[server]}" $result
if [ "$i" -eq 0 ]; then
if [ "$i" -eq 0 ]; then # 0 => clicclac.info
# Dans zenphoto, mettre en cache les photos
echo -e "\n${bold}5. Go to ${italic}https://clicclac.info/zenphoto/${reset}${bold} and update cache manager...${reset}\n"
open https://clicclac.info/zenphoto/zp-core/zp-extensions/cacheManager/cacheImages.php?album=photos-du-mois
open "https://clicclac.info/zenphoto/zp-core/zp-extensions/cacheManager/cacheImages.php?album=photos-du-mois"
#elif [ "$i" -eq 1 ]; then
else