Compare commits
2 Commits
3761577922
...
a31d797eaa
Author | SHA1 | Date | |
---|---|---|---|
a31d797eaa | |||
b1c03b5098 |
@ -71,4 +71,4 @@ This will set up an environment with:
|
||||
|
||||
## Contributing
|
||||
|
||||
Feel free to fork this repository and make your own changes. If you have any improvements or suggestions, please open an issue or submit a pull request.
|
||||
Feel free to fork this repository and make your own changes. If you have any improvements or suggestions, please open an issue or submit a pull request.
|
||||
|
@ -1,7 +1,7 @@
|
||||
{pkgs, ...}: {
|
||||
systemd = {
|
||||
timers."nextcloud-cron" = {
|
||||
wantedBy = [""];
|
||||
wantedBy = ["timers.target"];
|
||||
timerConfig = {
|
||||
OnBootSec = "5m";
|
||||
OnUnitActiveSec = "5m";
|
||||
@ -11,6 +11,19 @@
|
||||
services."nextcloud-cron" = {
|
||||
script = ''
|
||||
set -eu
|
||||
|
||||
CONTAINER_NAME="nextcloud-nextcloud-1"
|
||||
|
||||
is_container_running() {
|
||||
${pkgs.docker}/bin/docker inspect -f '{{.State.Running}}' "$CONTAINER_NAME" 2>/dev/null | grep -q "true"
|
||||
}
|
||||
|
||||
while ! is_container_running; do
|
||||
echo "Waiting for $CONTAINER_NAME to start..."
|
||||
sleep 10
|
||||
done
|
||||
|
||||
echo "$CONTAINER_NAME is running. Executing CRON job..."
|
||||
${pkgs.docker}/bin/docker exec -u www-data -it nextcloud-nextcloud-1 php /var/www/html/cron.php
|
||||
'';
|
||||
serviceConfig = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user