diff --git a/mypdr/README.md b/mypdr/README.md index 390dc4e9..6fcda2d8 100644 --- a/mypdr/README.md +++ b/mypdr/README.md @@ -50,3 +50,25 @@ server { # instrucciones para crear el Secret y usarlo en los pods https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + + + +# como borrar tags + + + +While accepted answer is a good end solution, there is a simpler way to achieve this, without using the API: just delete the tag dirs manually from registry storage and then run the garbage-collect. + +First identify where your registry stores the data. By default it goes to /var/lib/registry dir inside the container, but its probably binded to your host one way or the other. I am using docker-compose with data volume so in my case its located at: /var/lib/docker/volumes/registry_data/_data/registry. + +You'll find dirs named as your project tags in there, relative to above path: v2/repositories//_manifests/tags + +Just delete the dirs which tag you dont want anymore. For example: + +rm -rf /var/lib/docker/volumes/registry_data/_data/registry/v2/repositories/I5/_manifests/tags/T12 + +Once you are done with that, run the garbage-collect: + +docker exec registry garbage-collect /etc/docker/registry/config.yml --delete-untagged + +Your registry config file may be in some other path, but this is the default. Read more about the garbage collector from docs, but the gist is: the registry binary inside the container includes a garbage-collect command, but you have to run it yourself. Of course you can always let the crontab run it for you. diff --git a/syncNC2LaCie b/syncNC2LaCie new file mode 100755 index 00000000..ef6ae89b --- /dev/null +++ b/syncNC2LaCie @@ -0,0 +1,43 @@ +comienzo=$(date "+%Y_%m_%d-%H_%M_%S") + +SINCRONIZANDO=/tmp/sincronizando +LOG=/tmp/resultadosync.log +ORIGEN=/mnt/Externo +DESTINO=/mnt/LaCie/BeeLink +DESTINOext=/mnt/Externo/Cluster + +RAIZ=/mnt/LaCie +PRUEBA=$RAIZ/ESTE_ES_EL_DISCO_DEL_ORDENADOR + +if [ -f "$PRUEBA" ]; then + + echo "Este es el disco del ordenador..." + mensaje="No he podido hacer la copia ya que parece que la LaCie CloudBox no está montada" + sudo -u creylopez echo $mensaje | mail -s "Error de sincronización con LaCie" "creylopez@yahoo.es" +else + echo "Es la LaCie..." +echo "$comienzo - Sincronizacion con LaCie" > $LOG +#echo "$comienzo - Sincronizacion con LaCie" + +if [ ! -f "$SINCRONIZANDO" ] +then + touch $SINCRONIZANDO + echo "Empieza sincronización..." >> $LOG + for i in fireflyiii nextcloud gogs navidrome mediawiki mealie wordpress mypdr vaultwarden repostajes enphase mivida nodered calibre lyrics repostajespy libros + do + echo "Guardando '$i'..." >> $LOG + sudo rsync -avh $ORIGEN/$i $DESTINO --delete >> $LOG + #sudo rsync -avh $ORIGEN/$i $DESTINOext --delete >> $LOG + done + final=$(date "+%Y_%m_%d-%H_%M_%S") + echo "$final - Fin de sincronizacion con LaCie" >> $LOG + sudo -u creylopez cat $LOG | mail -s "Copia realizada" "creylopez@yahoo.es" > /tmp/erroressync.log 2>&1 + rm $SINCRONIZANDO +else + echo "ya se está sincronizando" +fi +fi +# +#sudo -u creylopez cat $new_name | mail -s "FireflyIII backup finished" "creylopez@yahoo.es" +# +