first commit with existing files

This commit is contained in:
2025-05-17 13:08:39 +02:00
commit cda37be691
29 changed files with 617 additions and 0 deletions

19
ncfiles/files.sh Normal file
View File

@@ -0,0 +1,19 @@
#!/bin/bash
cd "$(dirname "$0")"
echo "Containers:"
sudo docker ps --format '{{.Names}}'
echo -n "Container name: "
read cont
sudo cp ./files/ncfiles.service /etc/systemd/system/ncfiles.service
sudo cp ./files/ncfiles.timer /etc/systemd/system/ncfiles.timer
sudo sed -i "s/%1%/$cont/g" /etc/systemd/system/ncfiles.service
sudo systemctl daemon-reload
sudo systemctl enable --now ncfiles.timer

View File

@@ -0,0 +1,7 @@
[Unit]
Description=Nextcloud files scan
[Service]
User=root
ExecStart=/usr/bin/docker exec --user www-data %1% /var/www/html/occ files:scan --all
KillMode=process

View File

@@ -0,0 +1,10 @@
[Unit]
Description=Scan Nextcloud files every 30 minutes
[Timer]
OnBootSec=30min
OnUnitActiveSec=30min
Unit=ncfiles.service
[Install]
WantedBy=timers.target