5.6 to 7.2 :
/usr/sbin/pkg info -xo ^php | /usr/bin/awk '{ gsub("56","72",$2); print " -o "$2" "$1}' | /usr/bin/xargs -L 1 /usr/local/sbin/portupgrade -by
7.2 to 7.3:
pkg info -xo php72 | awk '{ gsub("72","73",$2); print " -o "$2" "$1}' | xargs -L 1 portupgrade -by
7.3 to 7.4:
pkg info -xo php73 | awk '{ gsub("73","74",$2); print " -o "$2" "$1}' | xargs -L 1 portupgrade -by
7.2 to 8.0:
pkg delete php72-hash php72-json; pkg info -xo ^php ^mod_php | grep php72 | awk '{gsub("72","80",$2); print " -o "$2" "$1}' | xargs -L 1 portupgrade -DbkycC --batch
#!/bin/sh
_mysqldump="/usr/local/bin/mysqldump"
_gzip="/usr/bin/gzip -9"
_date="/bin/date"
_log="/var/log/mysqlbackup.log"
date=`${_date} +'%d%m%y-%H%M'`
date_log=`${_date} +'%d%m%y %H:%M:%S'`
echo "Backup start ${date_log}" >> ${_log}
${_mysqldump} zabbix | ${_gzip} > /kerya3/backups/mysql/zabbix-${date}.sql.gz
date_log=`${_date} +'%d%m%y %H:%M:%S'`
echo "Backup end ${date_log}" >> ${_log}
Original from https://ubuntuforums.org/showthread.php?t=2264947 which works for me
==================
sudo su
apt-get install lvm2
vgchange -a y
(do any lvm management you need here, I didn't need any.)
mkdir /mnt/system
mount /dev/mapper/ubuntu--vg-root /mnt/system
mount /dev/sda1 /mnt/system/boot
for i in /dev/pts /dev /proc /sys; do mount -B $i /mnt/system$i; done
chroot /mnt/system
update-initramfs -k all -c
update-grub
exit
for i in /dev/pts /dev /proc /sys; do umount /mnt/system$i; done
umount /mnt/system/boot
umount /mnt/system
==================
Source: https://serversitters.com/get-a-list-of-all-email-accounts-on-a-cpanel-server.html
# cat email-list.sh
#!/bin/bash
OWNER=$@
KONTA=`ls -1A /var/cpanel/users/`
count=1
for x in `echo -n "$KONTA"`;do
wiersz=`grep -i ^dns /var/cpanel/users/"$x" |cut -d= -f2`
DOMAIN[$count]=$wiersz
count=$[$count+1]
echo "Login: `echo "$x"`"
for i in `echo "${DOMAIN[@]}" | sed 's/ /\n/g'`;do
for n in ` ls -A /home/"$x"/mail/"$i"/ 2>/dev/null`;do
if [ "$n" == "cur" ];then echo "$n" > /dev/null
elif [ "$n" == "new" ];then echo "$n" > /dev/null
elif [ "$n" == "tmp" ];then echo "$n" > /dev/null
elif [ "$n" == "" ];then echo "$n" > /dev/null
else
echo "$n"@"$i"
fi
done
done
echo;echo;
done