From e4bdbca5ce128a14edc087522eac5931774c58a6 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 24 Oct 2018 18:13:53 +0200 Subject: Install a daily cron for media permission --- INSTALL.md | 2 +- install/ishtar-cron-daily | 8 ++++++++ install/ishtar-install | 9 +++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 install/ishtar-cron-daily diff --git a/INSTALL.md b/INSTALL.md index 459f1e330..7edfe8ff4 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -4,7 +4,7 @@ Install Install from Git ---------------- -This procedure only works for Debian Jessie/Stretch for now. +This procedure only works for Debian Stretch for now. If you know bash and your distribution the script should be easy to adapt (contributions are welcomed!). ``` diff --git a/install/ishtar-cron-daily b/install/ishtar-cron-daily new file mode 100644 index 000000000..5629a7071 --- /dev/null +++ b/install/ishtar-cron-daily @@ -0,0 +1,8 @@ +#!/bin/sh + +ISHTAR_PATH=#ISHTAR_PATH# +WWW_USER=www-data +WWW_GROUP=www-data + +find $ISHTAR_PATH -type d -name "media" -exec chown -R $WWW_USER:$WWW_GROUP {} \; +find $ISHTAR_PATH -type d -name "CACHE" -exec chown -R $WWW_USER:$WWW_GROUP {} \; diff --git a/install/ishtar-install b/install/ishtar-install index f9c841cb6..2885739a6 100755 --- a/install/ishtar-install +++ b/install/ishtar-install @@ -294,6 +294,15 @@ EOF exit 1 fi + echo "" + cecho y "Install cron script" + echo "" + + sed -s "s|#ISHTAR_PATH#|$full_install_path|g;" \ + "install/ishtar-cron-daily" > \ + "/etc/cron.daily/ishtar" + chmod u+x "/etc/cron.daily/ishtar" + echo "-------------------------------------------------------------------------------"; cecho y "Update debian packages cache"; echo ""; -- cgit v1.2.3