Webmin database backup vs command line

6 posts / 0 new
Last post
#1 Mon, 02/26/2018 - 05:55
Parapluie

Webmin database backup vs command line

Hullo, all.

I can backup my databases from the command line using mysqldump, but I cannot use the VirtualMin automatic backup tool.

When I try to use Virtualmin, I get the error(s):

Backing up 1 MySQL databases on ded.[server name].com ..
Backing up [database name] to /backup/[subdirectory] ..
.. backup failed : sh: /backup/[subdirectory]/: Is a directory
Warning: Using a password on the command line interface can be insecure.
mysqldump: Got errno 32 on write
Filesystem size : 458.32 GB  Free space : 434.02 GB


Since I would rather use the Webmin interface, is there any way to easily fix this?

Here is my command-line command, if it helps:

mysqldump --databases [database name] --result-file=/backup/[subdirectory]/file.sql


Any thoughts?

Kenneth

Tue, 02/27/2018 - 09:17
scotwnw

"Is a directory" Either the directory already exists or it doesnt know how to write to /directory/. Try variable substitution. Make last folder /%m-%d-%y/

Then enable variable and time substitution in the webmin, mysql module config?

Do strftime substitution of backup destinations? Yes

Do Webmin variable substitution on backup destinations? Yes

Fri, 04/27/2018 - 11:26 (Reply to #2)
Parapluie

Thank you, Scot.

I never did figure out how to get Webmin to do this for me. In the end, I created a .sh file with a mysqldump command within. I run it as a regular CRONjob, and it seems to be working well.

Let me know if anyone sees any problems with this approach.

Wed, 12/19/2018 - 00:20 (Reply to #3)
akshay13aac

Hey Parapluie, Getting Same Errors, Can You Please Share the .sh file with mysqldump commands and how to add the .sh files to Cronjob

Wed, 12/19/2018 - 10:32 (Reply to #4)
Parapluie

Any time, Akshay.

#!/bin/bash
#script for cronjob backups of a database
mysqldump --databases databaseName --result-file=/backup/mysiteBackupSubfolder/databaseName-$(date +%y%m%d-%H.%M.%S).sql.txt

Change "databaseName" to the name of your database.

Change the path following "result-file" to your save location. My system runs CentOS 6, so I throw the backups in the /backup directory.

Then, just set up a CRONjob to run the script. In and out.

The "date+" sequence adds a unique identifier to the file name for easy comparisons.

Glad to help.

K.

Fri, 03/08/2019 - 12:28
Parapluie

Do you really think I didn't read the manual? Or are you really just trying to teach me how to dump spam links into an unhelpful comment?