From fcd587392730ad7e3e9b834ee332aafc74f40381 Mon Sep 17 00:00:00 2001 From: ljf Date: Wed, 17 Jan 2018 18:17:38 +0100 Subject: [PATCH] [fix] Cron issue during custom backup --- src/yunohost/backup.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/yunohost/backup.py b/src/yunohost/backup.py index 0c957db7e..15c793802 100644 --- a/src/yunohost/backup.py +++ b/src/yunohost/backup.py @@ -1543,9 +1543,13 @@ class BackupMethod(object): # 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) if os.stat(src).st_dev == os.stat(dest_dir).st_dev: - os.link(src, dest) - # Success, go to next file to organize - continue + # Don't hardlink /etc/cron.d files to avoid cron bug + # 'NUMBER OF HARD LINKS > 1' see #1043 + 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, # prepare a list of files that need to be copied