virtualmin / virtualmin-gpl

Virtualmin web hosting control panel for Webmin
https://www.virtualmin.com
GNU General Public License v3.0
331 stars 102 forks source link

Backup SSH - Escaping / at the end #65

Open Bischi1997 opened 5 years ago

Bischi1997 commented 5 years ago

Versions: OS: CentOS 7.5.1804 Webmin version: 1.900 Usermin version: 1.750 Virtualmin version: 6.04 Authentic theme version: 19.21

Steps to reproduce:

  1. Create a new backup to an SSH Server.
    • All Virtual Servers
    • All Features
    • SSH Server with the following settings:
    • For the path enter something like "/backup/%d-%m-%Y-%H.%M/"
    • Delete old backups: yes, 30 days
    • Do strftime-style: ticked
    • One file per server
    • Full backup
    • Simple Schedule: hourly
  2. Save the newly created scheduled backup
  3. When you now check the entries again, you get "/backup/%d-%m-%Y-%H.%M"
  4. When you now run the backup job you will get this error: .. upload failed! user@server's password: /backup/29-11-2018-13.00/example.com.tar.gz.info: Not a directory

In step 4. the directory "backup" is created. However since the "/" at the ending is escaped, virtualmin creates a file instead of a directory.

It is possible to create a backup if I select "Single archive file" instead of "One file per server".

jcameron commented 5 years ago

The trailing slash should get automatically removed when creating a backup like this, which should cause Virtualmin to create destination directories matching /backup/%d-%m-%Y-%H.%M (unless that already exists as a file?)