Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Teo

Pages: [1]
1
Backup / Re: Custom Backup
« on: October 01, 2020, 08:26:10 AM »
Thanks for sharing this script.
What about moving the ďif backup_exclude.confĒ before to speedup the process and limiting the disk usage?
(the backup_exclude.conf lines have to be relative to user home, so if I need to exclude the folder /home/myuser/public_html/var/cache, Iíll write public_html/var/cache/)
Code: [Select]
#!/usr/bin/bash
tmp_dir=/home/tmp_bak/
backup_dir=/backup/custom/
retention=2
# -------------------
mysql root_cwp -B -N -s -e "SELECT username,domain FROM user WHERE backup='on'" | while read -r username domain
do

echo Custom backup task starting for $username at $domain
mkdir -p ${tmp_dir}${username}/home_dir
echo Copying home directory
if [ -f /home/${username}/backup_exclude.conf ]; then
ionice -c 3 nice -n +19 rsync -a --links --exclude-from=/home/${username}/backup_exclude.conf /home/${username}/ ${tmp_dir}${username}/home_dir
else
ionice -c 3 nice -n +19 rsync -a --links /home/${username}/ ${tmp_dir}${username}/home_dir
fi
echo Backing up databases
mkdir -p ${tmp_dir}${username}/mysql/
mysql --defaults-extra-file=/root/.my.cnf -e "show databases LIKE '${username}%';" | grep -v Database | while read databasename
 do
     echo Dumping $databasename
     mysqldump --defaults-extra-file=/root/.my.cnf "$databasename" > ${tmp_dir}${username}/mysql/"$databasename.sql" \
               2> ${tmp_dir}${username}/mysql/errors.txt

 done
if [ -d /var/vmail/${domain} ]; then
 mkdir -p ${tmp_dir}${username}/vmail/
 echo Copying email
 ionice -c 3 nice -n +19 cp -fR /var/vmail/${domain} ${tmp_dir}${username}/vmail/
fi
echo Consolidating files
ionice -c 3 nice -n +19 tar -cjf ${tmp_dir}${username}.tar.bz2 ${tmp_dir}${username}
mv ${tmp_dir}${username}.tar.bz2 ${backup_dir}${username}-$(date -d "today" +"%Y%m%d%H%M").tar.bz2
echo Cleaning up
/usr/bin/find ${backup_dir} -name "*.bz2" -mtime +${retention} -delete > /dev/null 2>&1
rm -Rf ${tmp_dir}${username}

done
echo Custom Backup Job Finished

2
Backup / Re: [Backup and NEW backup] what about ignoring symbolic links?
« on: October 01, 2020, 08:17:43 AM »
Look at "Custom Backup" thread.
Thank you cynique, Iíve just seen your feedback  :)

3
Backup / [Backup and NEW backup] what about ignoring symbolic links?
« on: September 25, 2020, 07:40:58 AM »
As already required, some kind of filed and folders exclusion could be very useful.
What Iím asking now it to exclude symbolic links from backup.
For sites with large data I often use external services like Amazon S3 mounted with s3fs-fuse or on other volume mounts.
Well, there was the default backup enabled and after some alerts from Netdata I saw the backup process
Code: [Select]
/usr/bin/rsync -avzr --no-o --no-g --delete /home/ACCOUNT/ /mnt/bk/cwp_backup/daily/ACCOUNTworking hard, downloading 2TB of files from Amazon S3 filling my local volume (and spending $ for AWS S3 traffic).
What about adding a --no-links to the command, or better, allowing to customize/override the backup script?



4
Please check that the user does not exist in / etc / pass, shadow and group as well as that / home / USER does not exist

Code: [Select]
cat /etc/passwd
cat /etc/group
ls -l /home/
gives no references about the users Iím trying to migrate

5
Iím trying a CWP to CWP account migration too. Both servers are CWPpro version: 0.9.8.1008 and I donít user email accounts.
/scripts/check_api is OK:
Code: [Select]
User API port 2302 check: OK
Oauth query check: OK
User API folder check: OK
External API port 2304 check: OK
External API files and htaccess : OK
CSF Firewall status check: ENABLED
TCP_IN for port 2304 set in /etc/csf/csf.conf: OK
TCP_OUT for port 2304 set in /etc/csf/csf.conf: OK

I can see the origin server from cwp_to_cwp with the list of all origin accounts, but every account migrations gives me the same error:
Code: [Select]
[2020-09-14 14:17:13] - Start import process CWPTOCWP_20200914141713
[2020-09-14 14:17:20] - Import Account myaccount
[2020-09-14 14:17:20] - Create Backup Account myaccount
[2020-09-14 14:17:23] - Start Transfer Backup myaccount
[2020-09-14 10:17:27] - Account Create Error myaccount

If I give a look at the detailed migration log /home/.CWPTOCWP_20200914141713/myuser.json I get:
Code: [Select]
{
    "BACKUP_ID": "myaccount202009141417150826b5c04738bedcc5ebc17dc643e103",
    "FILE_NAME": "cwpmove-myaccount.tar.gz",
    "FILE_BACKLOG": "master.log",
    "FILE_BACK_ELOG": "",
    "STATUS": "11",
    "LOGS": " [2020-09-14 14:17:22] - Start Backup myaccount<br> [2020-09-14 14:17:22] -  Create Backup Account myaccount<br> [2020-09-14 14:17:23] - Completed Backup myaccount <br>  [2020-09-14 10:17:26] - Start Transfer Backup myaccount<br> [2020-09-14 10:17:26] -  Start Transfer Backup myaccount<br>  [2020-09-14 10:17:26] - Transfer Backup Completed myaccount<br> [2020-09-14 10:17:27] - Account Create Error Check All Fields (only lower caps are allowed and no special characters or empty spaces... myaccount<br>",
    "PERCENTAGE": 60
}

Reading: ďAccount Create Error Check All Fields (only lower caps are allowed and no special characters or empty spaces... myaccountĒ Iíve tried replacing the account password with only lowercase and number characters but I get the same issue.

On the new server I can create new accounts and cPanel account restore works. Do you have suggestions better investigating the issue? A more detailed error log could helpÖ

6
Installation / Re: Canít install Netdata from GUI
« on: September 10, 2020, 09:00:57 AM »
After rebooting I get the same result and I canít uninstall it
I donít know if it is related, but
  • Iíve compiled some PHP versions in "PHP-FPM Selector"
  • selected Nginx & Varnish & Apache in "Setup default Web Servers"
and now Netdata installer works

7
Installation / Canít install Netdata from GUI
« on: September 09, 2020, 12:57:03 PM »
I use CWP7pro on two VPS with Netdata installed in past; yesterday Iíve installed CWP (CWPpro version: 0.9.8.1007) on a dedicated server
Code: [Select]
CPU Model: Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
CPU Details: 8 Core (3814 MHz)
Distro Name: CentOS Linux release 7.8.2003 (Core)
Kernel Version: 3.10.0-1127.19.1.el7.x86_64
Platform: x86_64
but I canít install Netdata from GUI using Graphs > Netdata > Install netdata:
I select the ďConfirmĒ checkbox, I press ďInstall netdataĒ button and then, after some seconds, I get back to the same page.
After rebooting I get the same result and I canít uninstall it with
Code: [Select]
/usr/local/src/netdata/packaging/installer/netdata-uninstaller.sh --yescommand because there isnít nothing to uninstall.

8
Backup / Re: Exclude a directory
« on: February 05, 2020, 02:11:54 PM »
A native option like cpbackup-exclude.conf for cPanel could be very useful.
I use it to excluding cache files using a pattern, so I can save a lot of backup space and speeding up the backup operation.

9
Did you see my follow up?
Iíve lost it but reading it now, i can restore single accounts creating a manual copy.
I hope in this ďcPanel Server MigrationĒ because when my new CWP server will be ready, Iíd like a bulk migration of all 50 accounts.

Iím trying the copy from
CentOS release 6.10 with cPanel v84.0.21
to
CentOS Linux release 7.7.1908 with CWPpro version 0.9.8.934

10
^ This is one of the rare cases where you can add your opposite server on each /etc/csf/csf.allow
Thanks for the suggestion, but nothing to doÖ

11
Hi there, Iíve tried following the guide but I have the ďConnection not reached errorĒ trying to test the connection.

If I try to directly login from CWP server to my cPanel server with
ssh root@CPANELIP -p2255
I havenít issues:


Do you have suggestions?
Thanks,
Matteo

Pages: [1]