Page 1 of 1

VestaCP new install: Some issues and questions

Posted: Tue Dec 19, 2017 12:23 am
by pivey
Hello,

have a fresh install of Vesta on a Centos 6.64x

Besides i really love Vesta, there are a few bugs i face and some questions:

Question 1:
I did some custom scripts to run via cron (transferring backups to remote backup server) and placed them to /usr/local/vesta/bin
Is that ok, or will they be overwritten on auto-update?

Issue 1:
I always can see 3 backups at 'Backups' but only two (2) are visible on WinSCP i use to access the server.
Also, on transferring files to remote server (via cron) only 2 are transferred.
Image
Image

Issue 2:
'Create Backup' says that Task has been added to the queue.. but i never receive a mail

Issue 3:
One of the custom scripts i made, to backup MySQL databases only does not complete due to error: access denied for root@localhost using password YES
I've checked mysql setup, the password is correct
I've done change to the Vesta password created following this thread: http://forum.vestacp.com/viewtopic.php?t=5444
and additionally changed old mysql password stored in my.cnf:
/root/.my.cnf

Your help is appreciated ;-)

Re: VestaCP new install: Some issues and questions

Posted: Tue Dec 19, 2017 5:42 pm
by imperio
Hi,
Write more about your first question about cron.
1. Fix for backups counter https://github.com/serghey-rodin/vesta/ ... 2f2e225e36
2. What email? about when the backup successfully created?

Re: VestaCP new install: Some issues and questions

Posted: Tue Dec 19, 2017 7:01 pm
by pivey
Hi imperio, thx for your feedback.

About question for cron:
I am having a custom script to backup non-Vesta folders & files and 1 to transfer Vesta backups to a mounted remote drive.
So i thought to place them within /usr/local/vesta/bin and configure cron via Vesta CP.
Nothing special, i could place them to different folder.. but that one seems convenient to me.
Just wanted to ask if there is change they get overwritten by an update.. in that case i have to change the location.
Should i? Or can i leave them at /usr/local/vesta/bin?

1. Thanks for the backup count fix ;-)

2. Yes, the notification in VestaCP (once manual backup is triggered) says that i get notified when backup is done. But i receive no email

Re: VestaCP new install: Some issues and questions

Posted: Tue Dec 19, 2017 7:19 pm
by imperio
pivey wrote:Hi imperio, thx for your feedback.

About question for cron:
I am having a custom script to backup non-Vesta folders & files and 1 to transfer Vesta backups to a mounted remote drive.
So i thought to place them within /usr/local/vesta/bin and configure cron via Vesta CP.
Nothing special, i could place them to different folder.. but that one seems convenient to me.
Just wanted to ask if there is change they get overwritten by an update.. in that case i have to change the location.
Should i? Or can i leave them at /usr/local/vesta/bin?

1. Thanks for the backup count fix ;-)

2. Yes, the notification in VestaCP (once manual backup is triggered) says that i get notified when backup is done. But i receive no email
1. This file will not be overwritten, If that a separate file with a different name.
2. I will check this problem on our test servers tomorrow.

Re: VestaCP new install: Some issues and questions

Posted: Tue Dec 19, 2017 8:32 pm
by pivey
Thanks again for the useful info

1. Yes, it's a separate file with a different name.
2. I will check this problem on our test servers tomorrow. -> Thnaks you!

Could you kindly advice if the 3rd issue i have is known problem to you (Vesta related).. or should i try a fix to mysql?
Issue 3:
One of the custom scripts i made, to backup MySQL databases only does not complete due to error:
Command '"./mysqlbackups.sh"'
failed with return code 0 and error message
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES).
I've checked mysql setup, the password is correct
I've done change to the (mysql) password created by Vesta setup, following this thread: http://forum.vestacp.com/viewtopic.php?t=5444
and additionally changed old mysql password stored in my.cnf:
/root/.my.cnf

Re: VestaCP new install: Some issues and questions

Posted: Tue Dec 19, 2017 9:10 pm
by pivey
imperio, in rgeard to the above issue:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES).

When i execute a custom script for MySQL via command line:
it seems that Vesta admin_default % (localhost) matches ''@'localhost' and mysql 'masks' that user against [email protected] the connection by trowing the error ERROR 1045 (28000)
I suppose that admin_default is used to run jobs for Vesta?
Do you have an idea for work around.. since it will always be an obstacle to run custom scripts for MySQL jobs ?
Image

Re: VestaCP new install: Some issues and questions

Posted: Tue Dec 19, 2017 11:36 pm
by pivey
Update:
1. I have removed admin_default & its database (have read a thread here at it can be safely been removed)

2. I have run
~# /etc/init.d/mysqld stop
~# mysqld_safe –skip-grant-tables &
~# mysql -u root
~# mysql> use mysql;
~# mysql> update user set password=PASSWORD(“my pass”) where User=’root’;
~# mysql> flush privileges;
~# mysql> quit
~# /etc/init.d/mysqld stop
~# /etc/init.d/mysqld start

3. Have tested to dump a database via cls .. and it worked fine

However, when executing my custom script (via cls or Vesta Cron).. in both cases the issue remains:

Code: Select all

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

Re: VestaCP new install: Some issues and questions

Posted: Thu Dec 21, 2017 9:21 am
by plutocrat
Hard to know what's going on in your backup script, I'd imagine its trying to run the backup script as root and failing somewhere. Here's what worked for me.

Login with ssh as the user who 'owns' the websites you're trying to backup. admin, perhaps or another.
Write your script with a specific user, password, database. eg

Code: Select all

mysqldump -u user -ppassword databasename > dump.sql
tar -czvf website.tar.gz /path/to/website/files
Add the cronjob to the user's crontab file with
crontab -e
23 04 * * * * /path/to/script/backup.sh

(Extra bonus: if you're backing up a wordpress instance you can use wp-cli)