Well, nope, need help anyway.
sudo docker exec -ti --user www-data nextcloud-app /var/www/html/occ files:scan --all is working like a charm. Now i want to use this as crontab:
sudo su
crontab -e
adding this line:
0 12 * * * sudo docker exec -ti --user www-data nextcloud-app /var/www/html/occ files:scan --all
-> run everyday this command at 12:00. But nothing is happening. Why? If i do something simpler like 0 12 * * * echo "test" > test.txt its working perfect - its creating a file ‘test.txt’. So syntax is correct. Any idea?
Also tried this way:
- go inside docker container
sudo docker exec -it nextcloud-app /bin/bash apt install -y cronapt install -y sudosudo crontab -e- add
0 12 * * * sudo -u www-data /var/www/html/occ files:scan --all
This is not working. So a cron inside a docker container also dont work. Tried theechoexample above inside container, but this also dont work.
root@287338265e0d:/var/www/html# /etc/init.d/cron status [FAIL] cron is not running ... failed!
Edit: So stupid, i had to activate this:
/etc/init.d/cron start
Now the cron is running inside the docker container and the occ commands runs well.