diff --git a/locales/en.json b/locales/en.json index 0aa8798fd..8f83b709c 100644 --- a/locales/en.json +++ b/locales/en.json @@ -101,6 +101,7 @@ "backup_output_directory_forbidden": "Forbidden output directory. Backups can't be created in /bin, /boot, /dev, /etc, /lib, /root, /run, /sbin, /sys, /usr, /var or /home/yunohost.backup/archives sub-folders", "backup_output_directory_not_empty": "The output directory is not empty", "backup_output_directory_required": "You must provide an output directory for the backup", + "backup_output_symlink_dir_broken": "You have a broken symlink instead of your archives directory '{path:s}'. You may have a specific setup to backup your data on an other filesystem, in this case you probably forgot to remount or plug your hard dirve or usb key.", "backup_running_app_script": "Running backup script of app '{app:s}'...", "backup_running_hooks": "Running backup hooks...", "backup_system_part_failed": "Unable to backup the '{part:s}' system part", diff --git a/src/yunohost/backup.py b/src/yunohost/backup.py index def7fb27b..0c957db7e 100644 --- a/src/yunohost/backup.py +++ b/src/yunohost/backup.py @@ -2301,6 +2301,11 @@ def backup_delete(name): def _create_archive_dir(): """ Create the YunoHost archives directory if doesn't exist """ if not os.path.isdir(ARCHIVES_PATH): + if os.path.lexists(ARCHIVES_PATH): + raise MoulinetteError(errno.EINVAL, + m18n.n('backup_output_symlink_dir_broken', + path=ARCHIVES_PATH)) + os.mkdir(ARCHIVES_PATH, 0750)