From 0ccb4b2c7fae05ad6800948346c5950efdda41e3 Mon Sep 17 00:00:00 2001 From: philc Date: Sun, 3 Nov 2024 08:48:51 +0100 Subject: [PATCH] add rsyncprod --- apxtri/setup/rsyncprod.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 apxtri/setup/rsyncprod.sh diff --git a/apxtri/setup/rsyncprod.sh b/apxtri/setup/rsyncprod.sh new file mode 100755 index 0000000..e9100ab --- /dev/null +++ b/apxtri/setup/rsyncprod.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# A REVOIR et à integrer dans un frontend +macle="/media/phil/BARN/Administratif/myworld/sshkey/philforwallants_rsa" +declare -a OBJETS=(articles jobads jobsteps jobtitles options persons quizz recruiters seekers sirets) + +for OBJET in "${OBJETS[@]}"; do + #rsync -p "$motdepasse" -avz -e "ssh -p 2230 phil@apptest.smatchit.io" /home/phil/apxtowns/testwall-ants/smatchit/objects/${OBJET}/ /media/phil/usbfarm/apxtowns/dev-ants/smatchit/objects/${OBJET}/ + rsync -avz -e "ssh -p 2230 -i ${macle}" --delete phil@apptest.smatchit.io:/home/phil/apxtowns/testwall-ants/smatchit/objects/${OBJET}/ /media/phil/usbfarm/apxtowns/dev-ants/smatchit/objects/${OBJET}/ + if [ $? -eq 0 ]; then + echo "$(date) - Synchronisation of $OBJET done." + else + echo "$(date) - Errorr synchronisation of $OBJET." + fi +done