From 6ca8c769ac2bc6994d21012052995c4f8d72271b Mon Sep 17 00:00:00 2001 From: medilies Date: Mon, 6 Dec 2021 22:31:48 +0100 Subject: [PATCH] 1.0.3 Fixed fusion-inv cron + file-backups cron --- glpi/scripts/files_backer_cron.sh | 20 ++++++++++++++++++++ glpi/scripts/install_fusioninventory.sh | 8 +++++--- 2 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 glpi/scripts/files_backer_cron.sh diff --git a/glpi/scripts/files_backer_cron.sh b/glpi/scripts/files_backer_cron.sh new file mode 100644 index 0000000..1153340 --- /dev/null +++ b/glpi/scripts/files_backer_cron.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# +# Writter : Boudouma Mohamed Ilies (medilies) +# Github repo: https://github.com/medilies/glpi +# My Linkedin: https://www.linkedin.com/in/medilies/ +# ----------------------------------------------------------------------------- + +# Script to create a cronjob for web directory backup +echo "*/1 * * * * root /scripts/files_backer.sh" >/etc/cron.d/files_backer && + chown root /etc/cron.d/files_backer && + chgrp root /etc/cron.d/files_backer && + chmod 0700 /etc/cron.d/files_backer && + # crontab -u root /etc/cron.d/files_backer && + /etc/init.d/cron restart + +# NOTE +# Debian cron specific, Set a cron job +# Just by putting a file with a cron job specification in /cron.d +# And making the file readable by root +# Then retarting cron diff --git a/glpi/scripts/install_fusioninventory.sh b/glpi/scripts/install_fusioninventory.sh index f54a624..c337c93 100644 --- a/glpi/scripts/install_fusioninventory.sh +++ b/glpi/scripts/install_fusioninventory.sh @@ -22,7 +22,9 @@ curl -L https://github.com/fusioninventory/fusioninventory-for-glpi/releases/dow glpicli plugin:install fusioninventory -u glpi && glpicli plugin:activate fusioninventory && chown -R www-data /var/www/html && - # - echo "*/1 * * * * php /var/www/html/front/cron.php &>/dev/null" \ - >>/etc/crontab && + echo "* */6 * * * root php /var/www/html/front/cron.php &>/dev/null" >/etc/cron.d/fusioninventory_taskschedular && + chown root /etc/cron.d/fusioninventory_taskschedular && + chgrp root /etc/cron.d/fusioninventory_taskschedular && + chmod 0700 /etc/cron.d/fusioninventory_taskschedular && + # crontab -u root /etc/cron.d/fusioninventory_taskschedular && /etc/init.d/cron restart