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?
“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
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.
#!/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.