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