Lutim have commands which can be used in cron jobs.
To see what commands are available:
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.
To generate statistics which can be viewed at the address /stats (we need to reload hypnotoad after the stats generation):
To automatically delete the IP addresses of image's senders after a configurable delay:
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.)
If delete_no_longer_viewed_files is set, the files not viewed since delete_no_longer_viewed_files days will be deleted too.
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.
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.
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.
carton exec script/lutim cron watch --mode production
Your Lutim is now fully ready!
I recommend you to read the update page, for when you'll update your Lutim instance.