[4093] | 1 | #!/bin/bash |
---|
| 2 | |
---|
[5934] | 3 | echo "Quel est votre login sur Ciclad " |
---|
| 4 | echo -n "Votre reponse : " |
---|
| 5 | read loginCiclad |
---|
| 6 | |
---|
| 7 | |
---|
[4093] | 8 | cd /ccc/work/cont003/igcmg/igcmg |
---|
| 9 | |
---|
| 10 | echo " Resultat du rsync en dry-run : " |
---|
| 11 | echo "" |
---|
[5934] | 12 | rsync -n --omit-dir-times -vrltgoD --progress --delete -e "ssh -ax -o ClearAllForwardings=yes -c blowfish" --exclude='CMIP6/*' --exclude='suivi-de-consomation/*' IGCM/ ${loginCiclad}@ciclad.ipsl.jussieu.fr:/projsu/igcmg/IGCM/ |
---|
[4093] | 13 | |
---|
| 14 | echo "Voulez vous effectuer les actions listees ci dessus oui/non ?" |
---|
| 15 | echo -n " Votre reponse : " |
---|
| 16 | read reponse |
---|
| 17 | |
---|
| 18 | case ${reponse} in |
---|
| 19 | |
---|
| 20 | oui|OUI|o) |
---|
[5934] | 21 | rsync --omit-dir-times -vrltgoD --progress --chmod=o-w --chmod=g-w --chmod=u-w --delete -e "ssh -ax -o ClearAllForwardings=yes -c blowfish" --exclude='CMIP6/*' --exclude='suivi-de-consomation/*' IGCM/ ${loginCiclad}@ciclad.ipsl.jussieu.fr:/projsu/igcmg/IGCM/ |
---|
[4093] | 22 | ;; |
---|
| 23 | non|NON|n) |
---|
[4105] | 24 | |
---|
| 25 | |
---|
| 26 | echo "Voulez vous sauvegarder la liste des actions dans un fichier oui/non ?" |
---|
| 27 | echo -n "Votre reponse : " |
---|
| 28 | read reponse2 |
---|
| 29 | |
---|
| 30 | case ${reponse2} in |
---|
| 31 | |
---|
| 32 | oui|OUI|o) |
---|
| 33 | VAR=`date +%Y-%m-%d` |
---|
| 34 | NAME=`whoami` |
---|
[5934] | 35 | rsync -n --omit-dir-times -vrltgoD --progress --delete -e "ssh -ax -o ClearAllForwardings=yes -c blowfish" --exclude='CMIP6/*' --exclude='suivi-de-consomation/*' IGCM/ ${loginCiclad}@ciclad.ipsl.jussieu.fr:/projsu/igcmg/IGCM/ > /ccc/work/cont003/igcmg/igcmg/TMP_SYNC/liste_action_ciclad_${NAME}_${VAR}.txt |
---|
[4105] | 36 | echo "vous trouverez la liste dans /ccc/work/cont003/igcmg/igcmg/TMP_SYNC/liste_action_ciclad_${NAME}_${VAR}.txt" |
---|
| 37 | ;; |
---|
| 38 | non|NON|n) |
---|
[4093] | 39 | ;; |
---|
| 40 | *) |
---|
| 41 | echo "Reponse non reconnue" |
---|
| 42 | ;; |
---|
[4105] | 43 | esac |
---|
| 44 | |
---|
| 45 | |
---|
| 46 | echo "FIN SCRIPT SYNCHRO ! nous passons à la mise à jour des droits " |
---|
| 47 | ;; |
---|
| 48 | *) |
---|
| 49 | echo "Reponse non reconnue" |
---|
| 50 | ;; |
---|
[4093] | 51 | esac |
---|
| 52 | |
---|
[5943] | 53 | echo "Mise a jour des droits sur les repertoires de donnees (ciclad), presse entree" |
---|
| 54 | read pause |
---|
| 55 | ssh ${loginCiclad}@ciclad.ipsl.jussieu.fr "setfacl -R -m u::rwX,g::rwX,o::r-X /projsu/igcmg/IGCM" |
---|
[4095] | 56 | |
---|
| 57 | |
---|
[5943] | 58 | |
---|
[4095] | 59 | echo "Verification des droits des repertoires TGCC" |
---|
| 60 | ccc_shspace_chmod userread /ccc/work/cont003/igcmg/igcmg/IGCM |
---|
| 61 | is_problem=` ccc_shspace_modck IGCM |grep ccc_shspace_chmod |wc -l` |
---|
| 62 | if [ "x${is_problem}" != "x0" ] |
---|
| 63 | then |
---|
| 64 | echo "Il y a un probleme de droit sur un repertoire qui ne vous appartient pas" |
---|
| 65 | echo "vous pouvez utiliser la commande ccc_shspace_modck IGCM pour savoir qui doit mettre a jour les droits" |
---|
| 66 | fi |
---|