index: add explicit link to save captures
[julm/camera.git] / push.sh
diff --git a/push.sh b/push.sh
index 3983c529e751f3f018e10eeb3741e8b733b94cb8..0a59b10adec704903ba031ae0bdd90fbfb323389 100755 (executable)
--- a/push.sh
+++ b/push.sh
@@ -17,4 +17,7 @@ for dir in "$@"; do
     --delete --delete-after --delete-excluded \
     "$user"/"$year"/fav/${month:+"$month"/} \
     mermet.wg:/var/lib/nginx/autogeree.net/"$user"/perso/camera/"$year"/${month:+"$month"/}
+    if test "$(date +%Y)" == "$year"; then
+      ssh mermet.wg ln -sf "$(date +%m)" /var/lib/nginx/autogeree.net/"$user"/perso/camera/"$year"/latest
+    fi
 done