• Home
  • WordPress
  • web Hosting
    • Free hosting
    • Cheap Hosting
    • comparison cloud , vps, shared, wordpress
    • managed wordpress hosting
    • managed cloud hosting
  • page Speed
  • Deals
  • Services
  • About

RAaz Kumar .com

wordpress tutorials seo hosting etc


mysql auto backup ubuntu 22.04 using automysqlbackup

Aim;  daily backup mysql in root folder using cron and mysqldmp & rsync
Local Host mysql backup:
0 1 * * * /usr/local/mysql/bin/mysqldump -uroot -ppassword –opt database > /path/to/directory/filename.sql
(There is no space between the -p and password or -u and username – replace root with a correct database username.)
sudo mkdir /var/backup/db
vim script.sh or nano script.sh
# (1) set up all the mysqldump variables
DATE=`date +”%d_%b_%Y_%H%M”`
SQLFILE=/var/backup/db/db_backup_${DATE}.sql
DATABASE=<database_name>
USER=<db_user>
PASSWORD=<db_user_password>
# (2) in case you run this more than once a day,
# remove the previous version of the file
unalias rm    2> /dev/null
rm ${SQLFILE}    2> /dev/null
rm ${SQLFILE}.gz  2> /dev/null
# (3) do the mysql database backup (dump)
sudo mysqldump -u ${USER} -p${PASSWORD} ${DATABASE}|gzip > ${SQLFILE}.gz
edit the my.cnf
[mysqldump]
quick
quote-names
max_allowed_packet      = 16M
user=root
password=complexPassword
Traverse to the script’s folder:
cd /var/backup/
And execute the following command:
sudo ./script.sh
Scheduling Execution with Cron
Edit the server’s cron with the undermentioned command:
sudo crontab -e
0 1 * * * /var/backup/script.sh
delete backups older than 7 days
sudo find /var/backup/db/. -mtime +7 -exec rm {} \;
back Up MySQL Databases with AutoMySQLBackup
sudo apt-get install automysqlbackup
Once installed, the script will automatically run once a day. Backups will be stored in the directory:
/var/lib/automysqlbackup
confuguration file
sudo nano /etc/default/automysqlbackup
manual run
sudo automysqlbackup
verify mysql
ls -R /var/lib/automysqlbackup/
/var/lib/automysqlbackup/daily/jobsite:
jobsite_2022-12-14_13h04m.Wednesday.sql.gz
/var/lib/automysqlbackup/daily/phpmyadmin:
phpmyadmin_2022-12-14_13h04m.Wednesday.sql.gz
/var/lib/automysqlbackup/daily/sarkarijobz:
sarkarijobz_2022-12-14_13h04m.Wednesday.sql.gz
/var/lib/automysqlbackup/daily/sys:
sys_2022-12-14_13h04m.Wednesday.sql.gz
/var/lib/automysqlbackup/monthly:
delete mysql backups older than 7 days
run rm command weekly
@weekly rm  -r /var/lib/automysqlbackup/daily/*
@monthly rm  -r /var/lib/automysqlbackup/weekly/*
view crontab -l
crontab -e
service cron reload
sudo find /var/lib/automysqlbackup/daily/. -mtime +7 -exec rm {} \;
Automysqlbackup – Could not open required defaults file: /etc/mysql/debian.cnf
by default, assigns many variables by the MySQL file located at “/etc/mysql/debian.cnf”. This contains maintenance login information
From this file, it reads the user, password, and databases that must be backed up.
https://manpages.ubuntu.com/manpages/focal/man8/automysqlbackup.8.html
Create  /etc/mysql/debian.cnf file add below details
client
db name
db pass
[client]
host     = localhost
user     = root
password = "mysupersecretpass"
socket   = /var/run/mysqld/mysqld.sock


optional
[mysql_upgrade]
host     = localhost
user     = root
password = mysupersecretpass
socket   = /var/run/mysqld/mysqld.sock
basedir  = /usr

Related topics:

  1. Lamp stack install on Ubuntu 20.4 LTS apache, mysql, php 7.4(Debian 9 & Ubuntu 18.04 lts)
  2. mysql workbench tutorials (Sql Development , modelling, server admin export & import)
  3. mysql 8 installation on ubuntu 20.4
  4. mysqldump import /export mysql database command line, phpmyadmin, Cpanel, mysql workbench, xamp
  5. mysql root password change reset update set A-Z info

tutorials

  • Vivek Bindra Videos Transcription (business strategy)
  • git commands
  • new relic php agent install in 3 steps
  • new relic mysql install integration - 2 ways fix problems
  • new relic installation linux (infrastructure agent , php, mysql , nginx)
  • xampp tutorials 2021 installation errors fix wordpress phpmyadmin mysql apache
  • Redis performance metrics & tuning for nginx apache ubuntu & debian
  • Devops course Syllabus topics PDF AWS, Azure, cisco, redhat
  • CCNA Syllabus pdf (CCNA / CCNP vs devops vs mcsa /MCSE)
  • how to create a website free of cost on google
  • what is vpn vs proxy vs tor, http vs https, http2, tcp vs udp, kali linux sql source code injection
  • nginx server tutorials (installation, configuration, performance tuning, security)
  • MySQL Tutorial (create,connect database, update tables, export etc) Documentation & TIPS
    • mysql 8 installation on ubuntu 20.4
    • mysql auto backup ubuntu 22.04 using automysqlbackup
    • mysqltuner installation suggestions
    • mysql memory limit setting increase or decrease allocation
    • mysql open_files_limit increase to raise open file cache table definition cache
    • mysql restart ubuntu status start stop in linux windows reload
    • monitoring mysql with new relic
    • mysql access denied for user 'root'@'localhost' (using password yes) no Error 1045
    • mysql slow query log enable disable set query time ideal mysql long query time
    • mysql user creation, password , grant permissions user management guide
    • mysql root password change reset update set A-Z info
    • mysql configuration file location linux , windows , mac
    • mysqldump import /export mysql database command line, phpmyadmin, Cpanel, mysql workbench, xamp
    • MySQL query cache vs redis vs memcached buffer pool database cache
    • MySQL innodb memory allocation & usage calculation
    • mysql max connections limit check increase how to decide thread cache size
    • Innodb vs myisam (table engines row lock vs table lock)
    • mysql errors
    • mysql workbench tutorials (Sql Development , modelling, server admin export & import)
    • How measure & adjust mysql buffer pool size by pages, read requests etc
    • improve mysql performance wordpress my.cnf file configuration
    • phpmyadmin install / configure on nginx ubuntu 20.04 apache2 debian 10
    • mysql commands
  • AUdio Editing Background Noise removal (Audacity, Adobe Premiere Addition, Camtasia Filmora Windows Obs)
  • Android Studio tutorials syllabus Topics Course details #AndroidApplicationDevelopment
  • [INTRO] Ethical hacking / cyber Security / Penetration testing Tutorial -{updates frequently}
  • redis install ubuntu 20.04 with wordpress php redis mysql configuration
  • ubuntu tutorials installation download issues etc
  • Php tutorials
  • HTML & CSS Tutorials
  • Core Java Tutorial Free online
  • Linux sysadmin tutorials linux system administrator
  • apache server tutorial (install,config, performance tuning, security, error handling)

 

 

wordpress Pagespeed optimization

Digitalocean free $100 Credit

Cloudways Review pricing promo codes

Siteground cpu limits Pricing

Shared Hosting

Managed wordpress Hosting

Managed Hosting Cloud server

VPS Hosting

Cloud Hosting – Unmanaged

Google cloud Pricing

Aws Pricing

Azure pricing

nginx server tutorials

apache server tutorials

linux sysadmin tutorials

mysql Commands list pdf

LEMP Install Ubuntu

Mysql Performance Tuning

Nginx Performance tuning

Linux Performance tuning

Php -fpm performance tuning

Redis Performance tuning

linux server security

nginx security best practices

wordpress security plugins

 

 

wordpress

 

Top 5  WP Google Analytics Plugins

WP Backup Plugins

Wp Comment Plugins

Top wordpress Security Plugins

WP Seo Plugins

WP Caching Plugins

Best Adsense Plugins for WordPress

Wp social Sharing Plugins

autoshare social media plugins

WP speed Optimization Plugins

Speedup WordPress google Score

More Wp tuts

Server Admin Cloud

 

Installing Nginx LEMP On ubuntu

Installing apache Lamp ubuntu

nginx fastcgi cache enable

php – fpm install  & Configuration

Opcache install & Configure

php -fpm pool manager explained

Mysql Install & Configuration

Redis Object cache install & configure

 

Nginx as Reverse Proxy and Load balancer

Load Balance / auto scaling in google cloud

Linux Commands PDF

Mysql Commands Pdf

Letsencrypt tutorial

mysqldump export & import 

Pagespeed Module install & configure

nginx.conf best file

mysql.conf best file

upgrade ubuntu

© 2023 - All Rights Reserved Disclaimer & Privacy Policy