Deleting Old Files
-
I wanted to make sure that this file path was correct for Jirafeau. See the screenshot below for the crontab item I have added per the documentation here: https://gitlab.com/jirafeau/Jirafeau#how-can-i-automatize-the-cleaning-of-old-expired-files. Does this look correct (file path)?

Also, is there a way to ensure that any files that are uploaded ONLY stay for say 7 days? Meaning, the option for files to stay longer or shorter or permanently are disabled...
Thanks,
Matt -
Hello @visamp
The @jirafeau app should run these jobs automatically.
The app includes https://git.cloudron.io/packages/jirafeau-app/-/blob/master/cron.sh#!/bin/bash set -eu cd /app/code echo "=> Run cron tasks" /usr/local/bin/gosu www-data:www-data php /app/code/admin.php clean_expired /usr/local/bin/gosu www-data:www-data php /app/code/admin.php clean_asyncWhich is scheduled by the
CloudronManifest.jsoncron."scheduler": { "housekeeping": { "schedule": "12 * * * *", "command": "/app/pkg/cron.sh" } }Did this not work?
@visamp said in Deleting Old Files:
Also, is there a way to ensure that any files that are uploaded ONLY stay for say 7 days? Meaning, the option for files to stay longer or shorter or permanently are disabled...
This is not documented very well. I will add this to our Cloudron docs if my following finding return to be true.
According to the official docs from the docker part: https://gitlab.com/jirafeau/Jirafeau/-/blob/master/docker/README.md?ref_type=headsAVAILABILITY_DEFAULT: setup which availability shows by default.But, we don't use these docker env vars and what is allowed to set there is also not documented.
I've dug into the source code and found this - https://gitlab.com/jirafeau/Jirafeau/-/blob/master/lib/functions.php?ref_type=heads#L1927-L1960:
function jirafeau_datestr_to_int($time_str) { $time = time(); switch ($time_str) { case 'minute': $time += JIRAFEAU_MINUTE; break; case 'hour': $time += JIRAFEAU_HOUR; break; case 'day': $time += JIRAFEAU_DAY; break; case 'week': $time += JIRAFEAU_WEEK; break; case 'fortnight': $time += JIRAFEAU_FORTNIGHT; break; case 'month': $time += JIRAFEAU_MONTH; break; case 'quarter': $time += JIRAFEAU_QUARTER; break; case 'year': $time += JIRAFEAU_YEAR; break; default: $time = JIRAFEAU_INFINITY; break; } return $time; }So, setting the following config in /app/data/custom.php:
$cfg['availability_default'] = 'week';restarted the app and now:

There is no longer the option to select a time period, so I assume, it worked, and the default is alwaysweek.Maybe you @visamp can test this and report back.
-
Found it.
In the/app/data/custom.phpyou need to set:// optional default selector $cfg['availability_default'] = 'week'; // only set 'week' to true $cfg['availabilities'] = array( 'minute' => false, 'hour' => false, 'day' => false, 'week' => true, 'fortnight' => false, 'month' => false, 'quarter' => false, 'year' => false, 'none' => false );an app restart is not even needed after changing option in the
/app/data/custom.php