12 changed files with 86 additions and 42 deletions
@ -1,2 +0,0 @@ |
|||
#!/bin/sh |
|||
sed -i '/session required pam_loginuid.so/c\#session required pam_loginuid.so' /etc/pam.d/cron |
@ -1,4 +1,5 @@ |
|||
<?php |
|||
$CONFIG = array( |
|||
'htaccess.RewriteBase' => '/', |
|||
'maintenance_window_start' => 1, |
|||
); |
|||
|
@ -1,11 +0,0 @@ |
|||
PATH=/usr/local/bin:/bin:/usr/bin |
|||
# m h dom mon dow command |
|||
|
|||
# Run Nextcloud cron tasks every 5 minutes |
|||
*/5 * * * * php -f /var/www/html/nextcloud/cron.php |
|||
|
|||
# Scan for new files every 15 minutes |
|||
*/15 * * * * php /var/www/html/nextcloud/occ files:scan --all |
|||
|
|||
# Dump database every hour |
|||
23 * * * * maint 01 01 |
@ -1,14 +0,0 @@ |
|||
[Unit] |
|||
Description=Load/Dump database on start/stop |
|||
After=postgresql.service |
|||
Requires=postgresql.service |
|||
|
|||
[Service] |
|||
Type=oneshot |
|||
RemainAfterExit=yes |
|||
EnvironmentFile=/etc/environment |
|||
ExecStart=/bin/bash -c "if [[ $(ls -t /vol/data/sql/ | head -1) == $DBNAME-updown.sql ]]; then db-load /vol/data/sql/$DBNAME-updown.sql; else echo 'updown.sql is not most recent file in database dir, skipping db-load'; fi" |
|||
ExecStop=/bin/bash -c "db-dump /vol/data/sql/$DBNAME-updown.sql" |
|||
|
|||
[Install] |
|||
WantedBy=multi-user.target |
@ -0,0 +1,9 @@ |
|||
[Unit] |
|||
Description=Nextcloud cron.php job |
|||
|
|||
[Service] |
|||
User=www-data |
|||
# Only run if Nextcloud is running |
|||
ExecCondition=/usr/local/bin/nc-occ status -e |
|||
ExecStart=/usr/bin/php -f /var/www/nextcloud/cron.php |
|||
KillMode=process |
@ -0,0 +1,9 @@ |
|||
[Unit] |
|||
Description=Run Nextcloud cron.php every 5 minutes |
|||
|
|||
[Timer] |
|||
OnStartupSec=5min |
|||
OnUnitActiveSec=5min |
|||
|
|||
[Install] |
|||
WantedBy=timers.target |
@ -0,0 +1,12 @@ |
|||
[Unit] |
|||
Description=Dump database for backup |
|||
After=postgresql.service |
|||
Requires=postgresql.service |
|||
|
|||
[Service] |
|||
# Only run if Nextcloud is running |
|||
ExecCondition=/usr/local/bin/nc-occ status -e |
|||
ExecStart=/usr/local/bin/maint |
|||
StandardOutput=journal |
|||
StandardError=journal |
|||
Type=oneshot |
@ -0,0 +1,8 @@ |
|||
[Unit] |
|||
Description=Backup database every hour |
|||
|
|||
[Timer] |
|||
OnCalendar=0/1:00:00 |
|||
|
|||
[Install] |
|||
WantedBy=timers.target |
@ -0,0 +1,16 @@ |
|||
[Unit] |
|||
Description=Load/Dump database on start/stop |
|||
After=postgresql.service |
|||
Requires=postgresql.service |
|||
|
|||
[Service] |
|||
Type=oneshot |
|||
StandardOutput=journal |
|||
StandardError=journal |
|||
RemainAfterExit=yes |
|||
EnvironmentFile=/etc/environment |
|||
ExecStart=/bin/bash -c "if [[ $(ls -t /vol/data/sql/ | head -1) == $DBNAME-on-shutdown.sql ]]; then db-load /vol/data/sql/$DBNAM-on-shutdown.sql; else echo \"$DBNAME-on-shutdown.sql is not most recent file in database dir, skipping db-load\"; fi" |
|||
ExecStop=/bin/bash -c "db-dump /vol/data/sql/$DBNAME-on-shutdown.sql" |
|||
|
|||
[Install] |
|||
WantedBy=multi-user.target |
@ -0,0 +1,12 @@ |
|||
[Unit] |
|||
Description=Scan for new files |
|||
After=postgresql.service |
|||
Requires=postgresql.service |
|||
|
|||
[Service] |
|||
# Only run if Nextcloud is running |
|||
ExecCondition=/usr/local/bin/nc-occ status -e |
|||
ExecStart=/usr/local/bin/nc-occ files:scan --all --home-only |
|||
StandardOutput=journal |
|||
StandardError=journal |
|||
Type=oneshot |
@ -0,0 +1,10 @@ |
|||
[Unit] |
|||
Description=Periodically scan for new files |
|||
|
|||
[Timer] |
|||
OnStartupSec=15min |
|||
OnUnitActiveSec=15min |
|||
RandomizedDelaySec=60 |
|||
|
|||
[Install] |
|||
WantedBy=timers.target |
Loading…
Reference in new issue