How to automatically create backup of all customers MySQL databases?

Follow

Comments

2 comments

  • Avatar
    Lucas van Rooij

    I don't have the option 'with arguments' available when I select command. If I select php script, the option with arguments does come available

  • Avatar
    Artyom Baranov

    @Lucas van Rooij

    That is because the article is for Windows and you are using Linux.

    In that case, you may create a script like as follows (you should be logged via SSH):

    # vi /root/script.sh
    MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqldump -u admin -A --events -r /root/backup_`date +%F.%s`.sql;

    Do not forget to make it executable:

    # chmod +x /root/script.sh

    After that, go to Plesk > Tools & Settings and create a Scheduled Task like on the screenshot: https://prnt.sc/gs8imr

     

Please sign in to leave a comment.