mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[fix] Cron issue during custom backup
This commit is contained in:
parent
eb38100265
commit
fcd5873927
1 changed files with 7 additions and 3 deletions
|
@ -1543,9 +1543,13 @@ class BackupMethod(object):
|
||||||
# Can create a hard link only if files are on the same fs
|
# Can create a hard link only if files are on the same fs
|
||||||
# (i.e. we can't if it's on a different fs)
|
# (i.e. we can't if it's on a different fs)
|
||||||
if os.stat(src).st_dev == os.stat(dest_dir).st_dev:
|
if os.stat(src).st_dev == os.stat(dest_dir).st_dev:
|
||||||
os.link(src, dest)
|
# Don't hardlink /etc/cron.d files to avoid cron bug
|
||||||
# Success, go to next file to organize
|
# 'NUMBER OF HARD LINKS > 1' see #1043
|
||||||
continue
|
cron_path = os.path.abspath('/etc/cron') + '.'
|
||||||
|
if not os.path.abspath(src).startswith(cron_path):
|
||||||
|
os.link(src, dest)
|
||||||
|
# Success, go to next file to organize
|
||||||
|
continue
|
||||||
|
|
||||||
# If mountbind or hardlink couldnt be created,
|
# If mountbind or hardlink couldnt be created,
|
||||||
# prepare a list of files that need to be copied
|
# prepare a list of files that need to be copied
|
||||||
|
|
Loading…
Add table
Reference in a new issue