|
|
# Cron jobs
|
|
|
|
|
|
Lutim have commands which can be used in cron jobs.
|
|
|
Lutim has commands which can be used in cron jobs.
|
|
|
|
|
|
To see what commands are available:
|
|
|
|
|
|
```
|
|
|
```shell
|
|
|
carton exec script/lutim cron
|
|
|
```
|
|
|
|
|
|
It is recommended to execute the cron tasks once a day:
|
|
|
|
|
|
* the statistics task takes a little bit of resources
|
|
|
* the delete IP task can be executed less than once a day. Or more. It exists for legal reasons, so you need to know when you have to delete the sender's IP addresses
|
|
|
* the delete expired files task is here to delete expired files. You can execute it less than once a day: if one asks for an expired image, the image is deleted. This task exists for images that are expired which no one wants to see
|
|
|
* the watch directory's file can be executed more than once a day if you're short on storage.
|
|
|
* The statistics task takes a little bit of resources
|
|
|
* The delete IP task can be executed less than once a day. Or more. It exists for legal reasons, so you need to know when you have to delete the sender's IP addresses
|
|
|
* The delete expired files task is here to delete expired files. You can execute it less than once a day: if one asks for an expired image, the image is deleted. This task exists for images that are expired which no one wants to see
|
|
|
* The watch files directory can be executed more than once a day if you're short on storage.
|
|
|
|
|
|
## Statistics
|
|
|
|
|
|
To generate statistics which can be viewed at the address `/stats` (we need to reload hypnotoad after the stats generation):
|
|
|
|
|
|
```
|
|
|
```shell
|
|
|
carton exec script/lutim cron stats --mode production && carton exec hypnotoad script/lutim
|
|
|
```
|
|
|
|
|
|
## Delete IP adresses from database
|
|
|
## Delete IP addresses from database
|
|
|
|
|
|
To automatically delete the IP addresses of image's senders after a configurable delay:
|
|
|
|
|
|
```
|
|
|
```shell
|
|
|
carton exec script/lutim cron cleanbdd --mode production
|
|
|
```
|
|
|
|
|
|
## Delete expired files
|
|
|
|
|
|
To automatically delete files which availability delay is over (when you choose that your image will be deleted after 24h / one week / etc.)
|
|
|
To automatically delete files whose delay has expired (when you choose that your image will be deleted after 24h / one week / etc.)
|
|
|
If `delete_no_longer_viewed_files` is set, the files not viewed since `delete_no_longer_viewed_files` days will be deleted too.
|
|
|
|
|
|
```
|
|
|
```shell
|
|
|
carton exec script/lutim cron cleanfiles --mode production
|
|
|
```
|
|
|
|
|
|
## Watch the size of the files directory
|
|
|
|
|
|
To execute an action when the files directory is heavier than `max_total_size`.
|
|
|
To execute an action when the files directory is bigger than `max_total_size`.
|
|
|
The available actions are `warn`, `stop-upload` and `delete`:
|
|
|
|
|
|
* `warn` prints a message on the standard out (which is normally mailed to you by `cron`) ;
|
|
|
* `stop-upload` prints a message on the standard out and creates the `stop-upload` file which prevents uploading and put a warn on Lutim interface ;
|
|
|
* **DANGEROUS OPTION!!!** `delete` prints a message on the standard out and delete older images until the files directory goes under quota.
|
|
|
* `warn` prints a message on the standard out (which is normally mailed to you by `cron`)
|
|
|
* `stop-upload` prints a message on the standard out and creates the `stop-upload` file which prevents uploading and puts a warn on the Lutim interface
|
|
|
* **DANGEROUS OPTION!!!** `delete` prints a message on the standard out and deletes older images until the files directory is below the quota
|
|
|
|
|
|
If the files directory go under quota, the `stop-upload` file is deleted. If you want to manually prevents uploading, create a file named `stop-upload.manual`.
|
|
|
If the files directory goes below the quota, the `stop-upload` file is deleted. If you want to manually prevent uploading, create a file named `stop-upload.manual`.
|
|
|
|
|
|
```
|
|
|
```shell
|
|
|
carton exec script/lutim cron watch --mode production
|
|
|
```
|
|
|
|
... | ... | @@ -59,7 +59,7 @@ carton exec script/lutim cron watch --mode production |
|
|
|
|
|
Your Lutim is now fully ready!
|
|
|
|
|
|
I recommend you to read the [update page](update), for when you'll update your Lutim instance.
|
|
|
I recommend you read the [update page](update), for when you'll update your Lutim instance.
|
|
|
|
|
|
-------
|
|
|
|
... | ... | |