mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Avoid miserably failing when attempting to create link in some edge case
This commit is contained in:
parent
a974d08897
commit
ea98cf557e
1 changed files with 12 additions and 3 deletions
|
@ -1633,7 +1633,16 @@ class BackupMethod(object):
|
|||
# 'NUMBER OF HARD LINKS > 1' see #1043
|
||||
cron_path = os.path.abspath('/etc/cron') + '.'
|
||||
if not os.path.abspath(src).startswith(cron_path):
|
||||
try:
|
||||
os.link(src, dest)
|
||||
except Exception as e:
|
||||
# This kind of situation may happen when src and dest are on different
|
||||
# logical volume ... even though the st_dev check previously match...
|
||||
# E.g. this happens when running an encrypted hard drive
|
||||
# where everything is mapped to /dev/mapper/some-stuff
|
||||
# yet there are different devices behind it or idk ...
|
||||
logger.warning("Could not link %s to %s (%s) ... falling back to regular copy." % (src, dest, str(e)))
|
||||
else:
|
||||
# Success, go to next file to organize
|
||||
continue
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue