# Docker setup & cron

**URL:** <https://help.nextcloud.com/t/docker-setup-cron/78547>\
**Category:** 📦 Appliances (Docker, Snappy, VM, NCP, AIO)\
**Tags:** docker, cron\
**Created:** [April 20, 2020, 10:45am UTC](https://help.nextcloud.com/t/docker-setup-cron/78547 "2020-04-20T10:45:09Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![maste9](https://help.nextcloud.com/user_avatar/help.nextcloud.com/maste9/32/7511_2.png) [@maste9](https://help.nextcloud.com/u/maste9)\
**Post date:** [November 30, 2020, 10:27am UTC](https://help.nextcloud.com/t/docker-setup-cron/78547/10 "2020-11-30T10:27:11Z")

</div>

I just migrated my nextcloud to a docker setup on a NAS as host system. First I used the second container solution but now switched to your proposal of using a script in the host’s cron service.

Yet I have two questions that maybe you or s.o. else have answers to:

1. Do these commands

> ```
> docker exec --user www-data nextcloud php occ files:scan --all
> docker exec --user www-data nextcloud php occ files:scan-app-data
> docker exec --user www-data nextcloud php occ preview:pre-generate
> exit 0
> 
> ```

represent **all relevant jobs** which are usually done by cron.php?

1. Does this solution have any advantage against for example **calling cron.php as a webjob** like e.g. [https://zeitfresser.net/nextcloud-cronjob-ueber-synology-erstellen/](https://zeitfresser.net/nextcloud-cronjob-ueber-synology-erstellen/) (de) proposes?

Oh, and a bonus question if I may:

1. It is a tiny setup for max 5 users mainly using the cloud during daytime. So I’d like to let my NAS sleep during nighttime. A 24/7 every-15-minutes cronjob would prevent this, right? **Is there any risk if I pause the cronjob during night hours ?**

---

_[View the full topic](https://help.nextcloud.com/t/docker-setup-cron/78547)._
