better info and backup

This commit is contained in:
Ste Vaidis 2024-01-22 17:21:09 +02:00
parent 31bf6ba56d
commit 72c7d14df8
3 changed files with 14 additions and 1 deletions

View File

@ -6,6 +6,10 @@ DIR=$1
[ $# -gt 1 ] && echo "Too many arguments" && exit
[ ! -d $DIR ] && echo "Directory ${DIR} does not exist" && exit
echo -ne " 🔎 Verify file"
bzip2 -tv $TAR
[ $? -ne 0 ] && "Cannot verify $TAR" && exit
./db -e ${DIR}
tar -cjpf ${DIR}.tar.bz2 ${DIR} ${DIR}.*
ls -l ${DIR}.tar.bz2 --color=auto

View File

@ -10,12 +10,16 @@ BB="\e[1;34m"
BW="\e[1;97m"
E="\e[00m"
DBUSER="root"
DBPASS="1234"
SRC=$1
DST=$2
[ ! -d $SRC ] && echo "Directory ${DIR} does not exist" && exit
[ -d $DST ] && echo "Directory ${DIR} already exist" && exit
function log() {
[ $1 == 0 ] && echo -e " ${G}[ OK ]${E}"; return
echo -e " ${R}[FAIL]${E}"

View File

@ -56,11 +56,16 @@ vendor/drush/drush/drush route | grep "/api/" | awk {'print $2'} | sed "s/'//g"
# echo
# fi
# SELECT count(nid) FROM node WHERE type='article'
COUNT=$(mysql -uroot -p1234 ${NAME} -Nse "SELECT name from ${NAME}.config WHERE name LIKE 'node.type%'" | sed 's/node.type.//g' | sort | uniq | wc -l)
echo
echo -e "🍓 Content types: ${COUNT}"
echo
mysql -uroot -p1234 ${NAME} -Nse "SELECT name from ${NAME}.config WHERE name LIKE 'node.type%'" | sed 's/node.type.//g' | sort | uniq
for TYPE in `mysql -uroot -p1234 ${NAME} -Nse "SELECT name from ${NAME}.config WHERE name LIKE 'node.type%'" | sed 's/node.type.//g' | sort | uniq`; do
TYPECOUNT=$(mysql -uroot -p1234 ${NAME} -Nse "SELECT count(nid) FROM node WHERE type='${TYPE}'")
printf '%8d %s \n' ${TYPECOUNT} ${TYPE}
done
echo
echo -e "🎃 Available users"