How to setup automysql backup/dump scripts for regular backups

    Posted in Linux Servers on Jul 30, 2018

    First download it via following link :-$ wget

    Create a directory in /root named as automysqlbackup and Unzip file :-$ tar zxvf automysqlbackup-v3.0_rc6.tar.gz /root/automysqlback

    After unzip install that file :-

    root@cloudtechtiq.comk:~$ sh

    -> Press enter

    -> Press enter

    then open:- /etc/automysqlbackup/automysqlbackup.conf$ vim /etc/automysqlbackup/automysqlbackup.conf
    make following changes in file

    -- CONFIG_mysql_dump_username='root'

    -- CONFIG_mysql_dump_password='web@123'

    -- CONFIG_mysql_dump_host='localhost'

    -- CONFIG_backup_dir='/autobackup' //don’t forget that you hav to create this directory

    -- CONFIG_multicore='no'

    -- CONFIG_db_names=()

    -- CONFIG_db_month_names=()

    -- CONFIG_db_exclude=('information_schema' 'test' 'mysql')

    -- CONFIG_do_monthly="01"

    -- CONFIG_do_weekly="1"

    -- CONFIG_rotation_daily=2

    -- CONFIG_rotation_weekly=14

    -- CONFIG_rotation_monthly=30

    -- CONFIG_mailcontent='log'

    -- CONFIG_mail_address=','

    Run following command(For taking backup locally in /autobackup folder)$ automysqlbackup

    cronjob settings :-

    A :- create a file :-$ vim /etc/automysqlbackup/

    B :- Put this script in this file :-

    /usr/local/bin/automysqlbackup /etc/automysqlbackup/automysqlbackup.conf 
    chown root.root /autobackup/db* -R 
    find /autobackup/db* -type f -exec chmod 400 {} \;
    find /autobackup/db* -type d -exec chmod 700 {} \;

    C :- Give execut permission to that file :-$ chmod +x

    D :- Than put entry in crontab for automatically running backup according to given timing :-$ crontab -e
    0 0 * * * /etc/automysqlbackup/

    E :- Restart the crond service for validate changes :-$ service crond restart

    If you want to send backup on another Server than follow Below Commands :-

    Install EPEL repository for CentOS 6:-$ wget$ sudo rpm -Uvh epel-release-6*.rpm
    After which you can install NcFTP:$ yum install ncftp -y
    Send backup on Destination server :-$ ncftpput -u Destination-username -p Dest.-password -Rm Destination-hostname/IP /Path on Destination server /autobackup/*
    Now or regular backup according to time (time,daily,weekly,monthly) follw below commands:-

    A :- create a script :-$  vim

    put this command in this :-

    ncftpput -u Destination-username -p Dest.-password -Rm Destination-hostname/IP /Path on Destination server /autobackup/*

    B :- Give execute permission to script :-$  chmod +x

    C :- add cron job for this script :-$ crontab -e
    30 9 * * * sh /

    send backup daily at 9.30 A.M

    Now on daily basis your backup will be automatically generate and will send to your destination server..