Backup from cli with custom output directory won't work


I am trying to create a backup with the command line interface over ssh. I am using ssh for it since it allows to choose the output directory for the backup.

I have a 50 GB disk aside my YunoHost installation on VPS SSD (ovh) and have mounted the 50 GB drive properly.

However, when I do:

sudo yunohost backup create --output-directory /path/to/a/backup/folder/on/my/50GB/disk

I end up with the error:

Error: Not enough free disk space on '/path/to/a/backup/folder/on/my/50GB/disk'

The thing is that the YunoHost installation is on a 20 GB disk while I am trying to back it up on a 50 GB empty disk, so there should not be any disk space issue (am I right?).

Any idea?

Best regards and thank you for the amazing work and community.

Can you write a file on ‘/path/to/a/backup/folder/on/my/50GB/disk’ (it will exclude a permission problem)
Can you verifiy with “df -h” command that there’s enough space.

You can also try this trick : by defaut yunohost do a backup in /home/yunohost.backup/archives
You can do a symbolic link from /home/yunohost.backup/archives to /path/to/a/backup/folder/on/my/50GB/disk

in order to do this,
sudo ln -s /home/yunohost.backup/archives /path/to/a/backup/folder/on/my/50GB/disk

Only do this command if you understand it

If after this, sudo yunohost backup create works, it means that there’s a bug :slight_smile:

Thanks for the answer.

I can write on the targetted device, as I have put the same permissions as /home/yunohost.backup/archives for root.

Plus, here is the output of df -h:
Filesystem Size Used Avail Use% Mounted on /dev/vda1 20G 15G 4,2G 79% / udev 10M 0 10M 0% /dev tmpfs 774M 73M 702M 10% /run tmpfs 1,9G 176K 1,9G 1% /dev/shm tmpfs 5,0M 0 5,0M 0% /run/lock tmpfs 1,9G 0 1,9G 0% /sys/fs/cgroup /dev/vdb1 50G 1,5G 46G 4% /mnt/vdb tmpfs 387M 0 387M 0% /run/user/1001
There are 46 GB available on /dev/vdb1 mounted on /mnt/vdb, while my YunoHost install is made on /dev/vda1 mounted on /.

I tried yout trick, that I understand, and indeed I get the following:
Warning: App 'phpmyadmin' will not be saved Warning: App 'wallabag2' will not be saved Error: Unable to back up the app 'kanboard' Warning: 18330+5 records in Warning: 18331+1 records out Warning: 9385943 bytes (9,4 MB) copied, 0,263293 s, 35,6 MB/s Error: Not enough free disk space on '/home/yunohost.backup/archives'

So, from what I understand here: there is no bug and the backup needs more than 46 GB of free disk space?

OK. The backup doesn’t need enough space because it’s copy some /etc configuration files and data from /home/yunohost.apps. The Warning and Error in the log, I’ve the same too (some apps are not backupable with yunohost backup).

What I don’t understand yet is the “Error: Not enough free disk space on '/home/yunohost.backup/archives” because it’s start to copy some files.

Can you chech what contains /home/yunohost.backup/archives? I expect there’s a tmp folder/directory and a file (the log file).

the backup needs more than 46 GB of free disk space?

At least the backup needs more space than you use on / because it’s do a copy in tmp folder, after it creates a tar.gz file and remove /tmp files. So if you have 30 giga of data in Yunohost, you need more than 30 giga of freespace on Backup space.

Are you french language native (I’m), if so let’s continue in French maybe :slight_smile:

Thanks for your help. I will stick with English if you don’t mind, for the sake of consistency with the initial post (but yeah, I am French n_n’)!

You put me on good rails with the use of a symbolic link. I have then double-checked it and retried with, instead:

sudo ln -s /path/to/a/backup/folder/on/my/50GB/disk /home/yunohost.backup

I have also created both archives and tmp folders in /path/to/a/backup/folder/on/my/50GB/disk. Therefore even the tmp folder used is located on the large disk I am aiming to use.

It worked like that!

I believe it didn’t work in the first place with the --output-directory option of the yunohost backup create because it doesn’t account for the tmp folder which in fact grows to at least 10+ GB. Perhaps the backup script should account for both archives and tmp folders, instead of solely archives.

Merci ! :blush:

1 Like