Virtualmin 3.85 fails to backup

Hello! I upgraded a Virtualmin GPL installation to 3.85 and now the backup job fails. Basically, I backup to an ssh target to this path /mnt/backups/mercury/%d-%m-%Y It used to work fine, but since I installed 3.85 it fails with the following message: upload failed! scp: /mnt/backups/mercury/08-05-2011: Not a directory I also tried with a trailing slash to the path, but I am getting the same error.

Status: 
Closed (fixed)

Comments

Howdy -- can you verify that in the settings for your backup job, that the "Create destination directory?" option is still checked?

yes, it is still checked.

Hmm, reading the error closer, it says that the destination isn't a directory (which may imply it exists as a file).

What output do you receive if you type this:

ls -lh /mnt/backups/mercury/08-05-2011

Exactly, for some reason it does not create a directory anymore, it creates a file...

On the backup form, what do you have selected for "Backup format" ?

one file per server, i believe bz2 format. i also selected the strftime-style time substitutions and the Transfer each virtual server after it is backed up.

oh, btw, since virtualmin 3.85 is installed i also have these errors coming in on the daily cron:

Failed to run /usr/share/webmin/virtual-server/sendratings.pl : No such file or directory at /etc/webmin/virtual-server/sendratings.pl line 11.

That sendratings.pl error is a separate bug - I'll fix that in the next release.

Regarding the format, did you select "Single archive file", "One file per server (old format)", or "One file per server".

sorry, i though i replied, but there must have been a server error and didn't notice. i have selected single archive. see comment #6

Ok, that should work .. I presume that the directory /mnt/backups/mercury already exists?

If you delete /mnt/backups/mercury/08-05-2011 and re-run the backup, is it re-created as a directory or a file? If a file, what does it contain?

Yes, the destination root exists. If I delete the file and re-run backup, it gets recreated as file. If I open it with nano, I see some weird stuff...

If you run file with that file as a parameter, what does it output?

Also, it would be useful to see the full output from the backup process or email ..

atlantis:/mnt/backups/mercury# file 14-05-2011
14-05-2011: bzip2 compressed data, block size = 900k

and

Backup failed! See the progress output above for the reason why. Total backup time was 01 minutes, 57 seconds.

Sent by Virtualmin at: https://mercury.foo.bar:10000

Creating backup for virtual server foo.bar ..


    Copying virtual server configuration ..
    .. done

    Backing up Cron jobs ..
    .. done

    Copying records in DNS domain ..
    .. done

    Saving mail aliases ..
    .. done

    Saving mail and FTP users ..
    .. done

    Backing up mail and FTP user Cron jobs ..
    .. none to backup

    Copying Apache virtual host configuration ..
    .. done

    Copying Apache log files ..
    .. done

    Copying SSL Apache virtual host configuration and certificate ..
    .. done

    Copying Logrotate configuration ..
    .. done

    Dumping MySQL database foo_com_roundcube ..
    .. done

    Dumping MySQL database foo_com_whmcs ..
    .. done

    Copying Procmail and SpamAssassin configuration files ..
    .. done

    Backing up Webmin ACL files ..
    .. done

    Backing up AWstats configuration file ..
    .. done

    Backing up DAV users file ..
    .. done

    Backing up Subversion repositories and configuration files ..
    .. done

    Creating TAR file of home directory ..
    .. done

    Uploading archive to SSH server atlantis.foo.bar ..
    .. done

Creating backup for virtual server mercury.foo.bar ..


    Copying virtual server configuration ..
    .. done

    Saving mail aliases ..
    .. done

    Saving mail and FTP users ..
    .. done

    Backing up mail and FTP user Cron jobs ..
    .. none to backup

    Copying Apache virtual host configuration ..
    .. done

    Copying SSL Apache virtual host configuration and certificate ..
    .. done

    Copying Logrotate configuration ..
    .. done

    Creating TAR file of home directory ..
    .. done

    Uploading archive to SSH server atlantis.foo.bar ..
    .. done

Creating backup for virtual server foo.eu ..


    Copying virtual server configuration ..
    .. done

    Copying records in DNS domain ..
    .. done

    Saving mail aliases ..
    .. done

    Saving mail and FTP users ..
    .. done

    Backing up mail and FTP user Cron jobs ..
    .. none to backup

    Copying Apache aliases ..
    Creating TAR file of home directory ..
    .. done

    Uploading archive to SSH server atlantis.foo.bar ..
    .. done

Creating backup for virtual server foo.ch ..


    Copying virtual server configuration ..
    .. done

    Copying records in DNS domain ..
    .. done

    Saving mail aliases ..
    .. done

    Saving mail and FTP users ..
    .. done

    Backing up mail and FTP user Cron jobs ..
    .. none to backup

    Copying Apache aliases ..
    Creating TAR file of home directory ..
    .. done

    Uploading archive to SSH server atlantis.foo.bar ..
    .. done

Creating backup for virtual server foo.de ..


    Copying virtual server configuration ..
    .. done

    Copying records in DNS domain ..
    .. done

    Saving mail aliases ..
    .. done

    Saving mail and FTP users ..
    .. done

    Backing up mail and FTP user Cron jobs ..
    .. none to backup

    Copying Apache aliases ..
    Creating TAR file of home directory ..
    .. done

    Uploading archive to SSH server atlantis.foo.bar ..
    .. done


    Saving Virtualmin configuration ..
    .. done

    Saving templates and plans ..
    .. done

    Saving email templates ..
    .. done

    Saving custom fields, links, categories and shells ..
    .. done

    Saving scheduled backups ..
    .. done

    Saving DKIM settings ..
    .. done

    Saving greylisting settings ..
    .. done

    Saving mail server configuration ..
    .. done

.. done

Uploading archive to SSH server atlantis.foo.bar ..
.. upload failed! scp: /mnt/backups/mercury/14-05-2011: Not a directory

Ok, I see the bug that is causing this now .. it is new in 3.85, and only triggers when doing a backup to a remote SSH server and backups are being copied one domain at a time.

The fix is to edit the file /usr/share/webmin/virtual-server/backups-lib.pl and change line 289 from :

                        local $mkcmd = $sshcmd." mkdir -p ".quotemeta($pathdir);

to:

                        local $mkcmd = $sshcmd." mkdir -p ".quotemeta($path);

Then run /etc/webmin/restart

Thank you! This fixed the problem :)

Automatically closed -- issue fixed for 2 weeks with no activity.