Lutim has 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 files directory 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):
carton exec script/lutim cron stats --mode production && carton exec hypnotoad script/lutim
Delete IP addresses from database
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 whose delay has expired (when you choose that your image will be deleted after 24h / one week / etc.)
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 bigger than
The available actions are
warnprints a message on the standard out (which is normally mailed to you by
stop-uploadprints a message on the standard out and creates the
stop-uploadfile which prevents uploading and puts a warn on the Lutim interface
deleteprints a message on the standard out and deletes older images until the files directory is below the quota
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
carton exec script/lutim cron watch --mode production
Your Lutim is now fully ready!
I recommend you read the update page, for when you'll update your Lutim instance.
Back to wiki's homepage.