YunoHost / issues

General issue tracker for the YunoHost project
72 stars 8 forks source link

CLI backup with a specified output directory generates additional files and directories #1869

Open SveDec opened 3 years ago

SveDec commented 3 years ago

Hi,

Please find here a report concerning the Yunohost backup system.

Describe the bug

Create a backup from the CLI with a specified output directory generates several files and directories in addition to the .tar archive and the JSON file.

Context

Steps to reproduce

Simply create a backup via the CLI using the --output-directory option :

sudo yunohost backup create --name "maindomain.tld_backup-system-outdir" --description "Manual backup of Yunohost system in a specified directory" --system --output-directory '/backup/system'

Expected behavior

Like what happens when you create a backup without specifing an output directory (thus creating it in /home/yunohost.backup/archives), only the .tar archive and the .info.json file should be created.

Logs

The backup creation output is OK :

Info : Création d’une archive de sauvegarde à partir des fichiers collectés...
Info : L'archive contiendra environ 67.0MiB de données.
Succès ! Sauvegarde terminée
name: maindomain.tld_backup-system-outdir
results: 
  apps: 
  system: 
    conf_ldap: Success
    conf_manually_modified_files: Success
    conf_ynh_certs: Success
    conf_ynh_settings: Success
    data_home: Success
    data_mail: Success
    data_xmpp: Success
size: 70217973

The complete logs can be found here : https://paste.yunohost.org/metekoxiyo.bash

Additional infos

Directory content

You can find below all the files and directories in the output directory after backup creation. It looks like every extra files and directories generated can be found in the .tar archive (which makes sense to me as the archive must contain everything needed by Yunohost) :

backup/system
├── backup.csv
├── conf
│   ├── ldap
│   │   ├── cn=config.master.ldif
│   │   └── dc=yunohost-dc=org.ldif
│   ├── manually_modified_files
│   │   ├── backup
│   │   │   └── system
│   │   │       └── conf
│   │   │           └── manually_modified_files
│   │   ├── etc
│   │   │   └── ssowat
│   │   └── manually_modified_files_list
│   └── ynh
├── maindomain.tld_backup-system-outdir.tar
├── data
│   ├── home
│   └── xmpp
├── hooks
│   └── restore
└── info.json

These 3 JSON files are the same :

Backup scopes

Also, if the example provided was a system-only backup, the behaviour is the same with a full or apps-only backup. The files and directories generated are :

Impact

I found in another, unrelated, issue, that the user there might face the same problem, which would indicate that this issue is not specific to my setup. Quote from https://github.com/YunoHost/issues/issues/1766 :

the command line backup operation outputs multiple files and directories in addition to the .tar archive

Possible resolution

I noticed the .tar archive seems to be the last file generated, so these files and directories are maybe temporary (i don't know how the backup system works), but are not deleted after the operation ?

Thank you for the awesome work on Yunohost and for your time on this issue !

zamentur commented 1 month ago

--output-directory was initially a way to get files without a tar, in order to rsync or do whatever. All this things will be solved by the work on backup location