Page 1 of 1

Vicidial repair

PostPosted: Wed Nov 09, 2016 3:50 am
by pyke
hi gain guys.... i just want to know on how to execute this repair automatically in a given time everyday.....

" mysqlcheck -u cron -p --repair --all-databases "

... and also steps on how to do it. thanks again guys for the help and more power to you

God bless!

Re: Vicidial repair

PostPosted: Wed Nov 09, 2016 6:45 am
by mflorell
Just put that command in the crontab
http://www.computerhope.com/unix/ucrontab.htm

Re: Vicidial repair

PostPosted: Fri Nov 11, 2016 12:54 pm
by Noah
You should run a check repair and optimize often
One liner for cron that will check repair and optimize at whatever time you specifiy for the cron.

mysqlcheck -uxxx -pxxx -cs dbname && mysqlcheck -uxxx -pxxx -rs dbname mysqlcheck -uxxx -pxxx -os dbname

Then grab a backup of the db.

Re: Vicidial repair

PostPosted: Tue Nov 15, 2016 11:22 pm
by pyke
thank you for the reply....

can i write directly this on crontab -e ...

01 9 * * * mysqlcheck -u cron -p'*****' --repair --all-databases

thanks again

Re: Vicidial repair

PostPosted: Tue Nov 15, 2016 11:34 pm
by gequiros
I create an script for this:
This will CHECK DB
mysqlcheck -u root -pPASSWORD --auto-repair --check -e -o --optimize --all-databases


and this will generate a BackUP with the time as part of file name ( and will be compressed ):
mysqldump -u root -pPASSWORD --all-databases | xz -9 > DB_BackUp-`(date +"%m-%d-%Y")`.sql.xz

I may be wrong, but you should enforce the check and the backup of DB, always worth to be prepared for a DISASTER !!!

Re: Vicidial repair

PostPosted: Wed Nov 16, 2016 5:17 am
by pyke
is it okay to write that? or should i write it like this on crontab

01 9 * * * /usr/bin/mysqlcheck -u root -p'PASSWORD' --auto-repair --check -e -o --optimize --all-databases

or this .....

01 9 * * * mysqlcheck -u root -p'PASSWORD' --auto-repair --check -e -o --optimize --all-databases

and what is the syntax to back up the database?

thanks for the help.... i really really appreciate it

Re: Vicidial repair

PostPosted: Wed Nov 16, 2016 6:53 am
by mflorell
We do have a script to check tables in VICIdial :)

# /usr/share/astguiclient/AST_DB_check_tables.pl --help
allowed run time options:
[--quick] = run test in QUICK mode, may not catch all issues
[--email-list=test.com:test2.com] = send email results to these addresses
[--email-sender=vicidial] = sender for the email results
[--test] = test
[--quiet] = quiet
[--debug] = verbose debug messages
[--debugX] = extra verbose debug messages