Check space left before backup
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Description
When backup process starts, it does not check if there is enough space left on the device based on an estimation of the current data. Would be helpful to check it to skip errors like
done
Dumping uploads ...
done
Dumping builds ...
done
Dumping artifacts ...
done
Dumping pages ...
done
Dumping lfs objects ...
done
Dumping container registry images ...
rsync: write failed on "/var/opt/gitlab/backups/repos/docker/registry/v2/blobs/sha256/13/133f0ce9fe50db9a4eed386c43508493a314c0ae15f755fed400b389c0ccbc28/data": No space left on device (28)
rsync error: error in file IO (code 11) at receiver.c(393) [receiver=3.1.2]
Backup failed
which leaves the server without space and a backup without being complete.
Proposal
I propose to check if the backup is going to fill the whole disk or not. If the check and estimation estimate there could be a space problem stop the process or warn the user about this issue. A link to this guide or suggestions like "Excluding specific directories from the backup" or "backup_path" variable would help too.
I know the software could not be complete sure how much space the backup is going to take, but at least warn based on an estimation using files that are going to be saved.