Scheduled Database Backup not working

I created /home/(username)/backup/DB folders as root from CLI

Then went to Virtualmin -> Edit Databases -> Manage -> Backup Database -> Selected following options - Path to server = /home/(username)/backup/DB - All Tables - Scheduled Backup Enabled? = Yes - Simple Schedule = Hourly (Also tried Times & Dates Selected Below with everything set to ALL except Minutes = 00)

Then I selected either Backup Now or Save, but none of these create any backups during last 6 - 7 hours now.

The DB directory is empty throughout last 7 hours in spite of my settings of scheduled backup.

Please advise what am I doing wrong or something else is expected for me to do on top of this configuration of scheduled backup.

Status: 
Closed (works as designed)
Virtualmin version: 
6.13
Webmin version: 
1.962

Comments

If you click "Backup Now", what output is shown in the UI? Are there any error messages?

When I click on Backup Now then I get following message.

Backup destination /home/centos/backup/DB is a directory Scheduled backup path, options and times for database updated.

For the test server DB backup scheduling I am getting emails with following content.

Backing up 1 MySQL databases on tst.jitesh.xyz ..

Backing up pmipla5_pmiplanet to /home/jitesh/backup/DB .. .. backup failed : sh: /home/jitesh/backup/DB: Is a directory mysqldump: Got errno 32 on write

Filesystem size : 338.96 GiB Free space : 227.44 GiB

Kindly advise.

Ilia's picture
Submitted by Ilia on Tue, 12/08/2020 - 06:45

Try using for backup format one file per server option, if backup destination path is a directory. Moreover, have a look at create destination directory option, that will automatically create destination directory if it's missing.

Thanks for the comment. I couldn't find "Backup Format" or "File Per Server" options anywhere on Backup Database page. Nor could I find option to "Create Destination Directory" option on that page.

How can I get these options enabled?

Ilia's picture
Submitted by Ilia on Thu, 12/10/2020 - 11:50

I couldn't find "Backup Format" or "File Per Server" options anywhere on Backup Database page.

I am sorry -- you were referring to a backup functionality in MySQL Database module.

I created /home/(username)/backup/DB folders as root from CLI .. Please advise what am I doing wrong or something else is expected for me to do on top of this configuration of scheduled backup.

Path on the server shouldn't be a directory but rather a file name, like:

 /home/(username)/backup/DB/database.sql

Thanks. I can see that it creates that SQL file every hour. But it doesn't maintain hourly SQL files, if I want to restore DB 5 hours ago for example.

Is there a way I can maintain multiple backup SQL files?

Thanks. I changed the Destination file name to Database_%c.sql but system created file exactly like this instead of Database_ddmmyyyy_hh:mm:ss.sql. Did I miss anything? I couldn't find the strftime option on that Database Backup configuration page. So I thought I just need to add %c in destination file name.

Ilia's picture
Submitted by Ilia on Tue, 12/15/2020 - 04:03

It will work if you enable strftime in MySQL module configuration.

Thanks for your comment and sharing the snapshot.

I have found the module configuration page and enabled the strftime. Now will check for next couple of hours and if all good will come back and mark the ticket closed. Thanks again.

Thanks again. I can see now hourly SQL files are getting generated in destination folder.

Thank you very much for already thinking of such requirement and getting it part of the module.

Wish All VirtualMin Teams a Very Happy New Year.

Ilia's picture
Submitted by Ilia on Thu, 12/31/2020 - 06:04

I'm glad you found it. I was reading your comment at first on the email message but just found out that you edited it already.

Merry Christmas and Happy New Year.

Sorry for late response. I thought case would close automatically after some days. Closing it now (works as designed).