Skip to content

Commit

Permalink
4.2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Cosvernauta authored Oct 17, 2022
1 parent 4d04948 commit be86de6
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions util/fnEstructuraRB.frd
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
fnEstructuraRB()
{
msg "Buscando prev en backups para montar como .prev" "INFO"
#APWARBCK=$(ssh -q ${IPSRV} "find ${RTINST}/.bck/ -name '${APWAR}.prev.*'" | head -1)
APWARBCK=$(ssh -q ${IPSRV} "ls -ltr ${RTINST}/.bck/${APWAR}.prev.*| tail -1")

msg "Creando comando para borrado de componente actual" "INFO"
CMD1="rm -rf ${RTINST}/${APWAR}"

msg "Creando comando para mover prev como componente actual" "INFO"
CMD1="$CMD1;mv ${RTINST}/${APWAR}.prev ${RTINST}/${APWAR}"

if [ $(echo $APWARBCK | wc -l) -gt 0 ]
then
APWARBCK=$(echo $APWARBCK | awk '{print $9}')
msg "Creando comando para mover backup de prev como componente previo" "INFO"
CMD1="$CMD1;mv ${APWARBCK} ${RTINST}/${APWAR}.prev"
else
msg "No existe un prev en backup para ser montado como .prev, se omite la creación de comando" "WARN"
fi

msg "Ejecutando comandos de estructura:" "INFO"
msg "$CMD1" "DEBUG"
ssh -q ${IPSRV} "${CMD1}"
}

0 comments on commit be86de6

Please sign in to comment.