Implement nextcloudcron systemd timer.
This commit is contained in:
parent
97e980fbf7
commit
0f9e8d2124
4 changed files with 48 additions and 0 deletions
6
roles/nextcloud/files/nextcloudcron.service
Normal file
6
roles/nextcloud/files/nextcloudcron.service
Normal file
|
@ -0,0 +1,6 @@
|
|||
[Unit]
|
||||
Description=Nextcloud cron.php job
|
||||
|
||||
[Service]
|
||||
User=www-data
|
||||
ExecStart=/usr/bin/php -f /var/www/nextcloud/cron.php
|
10
roles/nextcloud/files/nextcloudcron.timer
Normal file
10
roles/nextcloud/files/nextcloudcron.timer
Normal file
|
@ -0,0 +1,10 @@
|
|||
[Unit]
|
||||
Description=Run Nextcloud cron.php every 5 minutes
|
||||
|
||||
[Timer]
|
||||
OnBootSec=5min
|
||||
OnUnitActiveSec=5min
|
||||
Unit=nextcloudcron.service
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
|
@ -9,3 +9,10 @@
|
|||
name: php{{ php_ver.stdout }}-fpm
|
||||
state: restarted
|
||||
listen: "restart php-fpm"
|
||||
|
||||
- name: enable nextcloudcron.service and .timer
|
||||
systemd:
|
||||
name: nextcloudcron.timer
|
||||
state: started
|
||||
enabled: True
|
||||
listen: "enable nextcloudcron.service"
|
||||
|
|
|
@ -199,3 +199,28 @@
|
|||
chdir: "{{ nc_dir }}"
|
||||
warn: False
|
||||
when: not notes.stat.exists
|
||||
|
||||
## nextcloudcron
|
||||
- name: provide nextcloudcron.service and .timer
|
||||
copy:
|
||||
src: "{{ item }}"
|
||||
dest: "/etc/systemd/system/{{ item }}"
|
||||
with_items:
|
||||
- nextcloudcron.service
|
||||
- nextcloudcron.timer
|
||||
register: nextcloudcron
|
||||
notify: "enable nextcloudcron.service"
|
||||
|
||||
- name: switch to systemd timer
|
||||
command: sudo -u www-data php ./occ background:cron
|
||||
args:
|
||||
chdir: "{{ nc_dir }}"
|
||||
warn: False
|
||||
when: nextcloudcron.changed
|
||||
|
||||
|
||||
## ToDo kerberox integration:
|
||||
# sudo -u www-data php ./occ app:enable user_ldap
|
||||
# sudo -u www-data php ./occ app:install user_saml
|
||||
|
||||
# sudo -u www-data php ./occ ldap
|
||||
|
|
Loading…
Add table
Reference in a new issue