From 5dbdb4475cf112d6dfdf55d903608d42d1e0735f Mon Sep 17 00:00:00 2001 From: Denis Cardon Date: Wed, 9 Dec 2020 17:03:59 +0100 Subject: [PATCH] move cron file creation in postinst to avoid overwrite in case of customisation --- deb/createdeb.sh | 1 - deb/postinst | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/deb/createdeb.sh b/deb/createdeb.sh index ef602ad..f729b74 100755 --- a/deb/createdeb.sh +++ b/deb/createdeb.sh @@ -21,7 +21,6 @@ mkdir -p ./builddir/etc/cron.d/ rsync -aP --exclude "deb/" --exclude "doc/" --exclude "rpm/" --exclude ".git" ../ ./builddir/opt/tisbackup rsync -aP ../scripts/tisbackup_gui.service ./builddir/usr/lib/systemd/system/ rsync -aP ../scripts/tisbackup_huey.service ./builddir/usr/lib/systemd/system/ -rsync -aP ../samples/tisbackup.cron ./builddir/etc/cron.d/tisbackup rsync -aP ../samples/tisbackup_gui.ini ./builddir/etc/tis rsync -aP ../samples/tisbackup-config.ini.sample ./builddir/etc/tis/tisbackup-config.ini.sample rsync -aP ../lib/huey/bin/huey_consumer.py ./builddir/opt/tisbackup/ diff --git a/deb/postinst b/deb/postinst index 5b5be81..8730a7b 100755 --- a/deb/postinst +++ b/deb/postinst @@ -5,3 +5,8 @@ systemctl enable tisbackup_gui if [ ! -f /usr/bin/tisbackup ]; then ln -s /opt/tisbackup/tisbackup.py /usr/bin/tisbackup fi + +if [ ! -f /etc/cron.d/tisbackup ]; then + cp /opt/tisbackup/samples/tisbackup.cron /etc/cron.d/tisbackup +fi +