Compare commits
8 Commits
master
...
nextcloud/
Author | SHA1 | Date |
---|---|---|
|
6e5efef072 | 2 years ago |
|
4c8c30a9ef | 2 years ago |
|
043fdb9492 | 2 years ago |
|
7e98539ca0 | 3 years ago |
|
68892ecb24 | 3 years ago |
|
aa0a7c73bf | 3 years ago |
|
14af1f594e | 3 years ago |
|
039fe69a37 | 3 years ago |
19 changed files with 125 additions and 42 deletions
@ -1,9 +1,20 @@ |
|||||
#!/bin/bash |
#!/bin/bash |
||||
|
|
||||
|
. /usr/local/bin/maint-mode |
||||
|
mode_get |
||||
|
mode_on |
||||
|
|
||||
if [[ ! -f $1 ]]; then |
if [[ ! -f $1 ]]; then |
||||
>&2 echo "Error: could not find file \"$1\"" |
>&2 echo "Error: could not find file \"$1\"" |
||||
exit 2 |
exit 2 |
||||
fi |
fi |
||||
|
|
||||
|
mode=$(nc-occ maintenance:mode | cut -d' ' -f 5) |
||||
|
if [[ $mode != "enabled" ]]; then |
||||
|
nc-occ maintenance:mode --on |
||||
|
fi |
||||
|
|
||||
db-make |
db-make |
||||
psql -U $DBUSER -d $DBNAME -f $1 |
psql -U $DBUSER -d $DBNAME -f $1 |
||||
|
|
||||
|
mode_off |
||||
|
@ -0,0 +1,22 @@ |
|||||
|
#!/bin/bash |
||||
|
|
||||
|
mode_get() { |
||||
|
mode=$(nc-occ maintenance:mode | cut -d' ' -f 5) |
||||
|
if [[ $mode == "enabled" || $mode == "disabled" ]]; then |
||||
|
echo $mode |
||||
|
return 0 |
||||
|
else |
||||
|
echo "Error: failed to get maintenance mode" 1>&2 |
||||
|
return 1 |
||||
|
fi |
||||
|
} |
||||
|
|
||||
|
mode_on() { |
||||
|
nc-occ maintenance:mode --on |
||||
|
} |
||||
|
|
||||
|
mode_off() { |
||||
|
if [[ $mode == "disabled" ]]; then |
||||
|
nc-occ maintenance:mode --off |
||||
|
fi |
||||
|
} |
@ -0,0 +1,9 @@ |
|||||
|
#!/bin/bash |
||||
|
|
||||
|
if [[ -n $1 ]]; then |
||||
|
nc-occ files:scan --path="/$1/files/" |
||||
|
else |
||||
|
for user in $(nc-occ user:list --output=json | jq -r 'keys[]'); do |
||||
|
nc-occ files:scan --path="/$user/files/" |
||||
|
done |
||||
|
fi |
@ -1,2 +0,0 @@ |
|||||
#!/bin/sh |
|
||||
sed -i '/session required pam_loginuid.so/c\#session required pam_loginuid.so' /etc/pam.d/cron |
|
@ -0,0 +1,8 @@ |
|||||
|
[Unit] |
||||
|
Description=Scan files every 15 minutes |
||||
|
|
||||
|
[Timer] |
||||
|
OnCalendar=0/15:00 |
||||
|
|
||||
|
[Install] |
||||
|
WantedBy=timers.target |
@ -0,0 +1,9 @@ |
|||||
|
[Unit] |
||||
|
Description=Nextcloud cron.php job |
||||
|
|
||||
|
[Service] |
||||
|
User=www-data |
||||
|
ExecStart=/usr/bin/php -f /var/www/nextcloud/cron.php |
||||
|
StandardOutput=journal |
||||
|
StandardError=journal |
||||
|
KillMode=process |
@ -0,0 +1,9 @@ |
|||||
|
[Unit] |
||||
|
Description=Run Nextcloud cron.php every 5 minutes |
||||
|
|
||||
|
[Timer] |
||||
|
OnBootSec=5min |
||||
|
OnUnitActiveSec=5min |
||||
|
|
||||
|
[Install] |
||||
|
WantedBy=timers.target |
@ -0,0 +1,8 @@ |
|||||
|
[Unit] |
||||
|
Description=Scan Nextcloud files for changes |
||||
|
|
||||
|
[Service] |
||||
|
ExecStart=/usr/local/bin/maint-scan |
||||
|
StandardOutput=journal |
||||
|
StandardError=journal |
||||
|
Type=oneshot |
@ -0,0 +1,8 @@ |
|||||
|
[Unit] |
||||
|
Description=Scan files every 15 minutes |
||||
|
|
||||
|
[Timer] |
||||
|
OnCalendar=0/15:00 |
||||
|
|
||||
|
[Install] |
||||
|
WantedBy=timers.target |
Loading…
Reference in new issue