to navigate to open Esc to close Search by Algolia

Command line tools

The command line tools are the PHP scripts inside the cron/ folder of your FileRun installation. Run them from that folder:

 1cd cron
 2php empty_trash.php --username superuser --days 30

You might need to point PHP at the configuration file your web server uses, so that the command runs with the same extensions loaded (ionCube among them) and not with the defaults:

 1php -c /the-full-path/to-your/php.ini script-file-name.php

Each script is a small wrapper around a command line route. The same routes can also be run through cli.php, in the root of the installation, which takes the route as its first argument and passes anything after it to the route:

 1php cli.php 'Core/!cli/cron/daily'

Scheduled tasks

These three have to be scheduled, or parts of FileRun stop working. The official Docker image sets them up for you; every other installation has to.

Script How often
everyMinute.php every minute
every5minutes.php every 5 minutes
daily.php once a day
 1everyMinute.php

Processes the metadata extraction queue: reads the information out of newly uploaded files (image dimensions, the date a photo was taken, the rest of the Exif, IPTC and XMP data) and assigns each file its FileRun file type, which is what filtering and searching by type rely on.

 1every5minutes.php

Clears the sessions of users who are no longer signed in.

 1daily.php

The daily maintenance. It deactivates expired user accounts, deactivates and deletes accounts that have been inactive for longer than the configured retention, deletes guest accounts that no longer have anything shared with them, archives old activity log entries, and removes expired OAuth2 grants, app passwords and sign-in flow records. It also clears old file activity records, deletes expired web links, removes sharing records that name a user or group that no longer exists, and cleans up database records of files that are no longer on disk.

All three do nothing while maintenance mode is enabled, and say so.

You will probably also want to schedule email_notifications.php, described below. Without it, no notification e-mail is ever sent.

E-mail

 1email_notifications.php

Sends the e-mail notifications queued by the users' actions. Notifications are not sent as the actions happen, so nothing is sent until this runs. Schedule it as often as you want the notifications delivered.

 1space_quota_notifications.php

Sends a warning e-mail to each user using more than a set percentage of their assigned storage space. The percentage is Quota warning level, under UsersSettingsStorage in the control panel. Nothing is sent when that setting is empty.

User accounts

 1reset_superuser_pass.php --password new-password

Sets the password of the superuser account. Without --password, a random password is generated and printed. It also ends every signed-in session of that account.

The password is an option, not a plain argument: reset_superuser_pass.php new-password is ignored and gives you a random password instead.

 1reset_superuser_2fa.php

Removes the superuser's second authentication factor, so that account can sign in with only its password. Use it when the passkey or the authenticator app is lost.

 1manage_inactive_users.php --days 90 --action list

Finds the accounts that have not signed in for more than the given number of days and then lists, deactivates or deletes them. --action takes list, deactivate or delete. The minimum for --days is 7. If you leave either option out, the command asks for it.

 1users_sync.php

Synchronises the FileRun user database with the remote list of users, when an authentication plugin that supports it is enabled. See Authentication integration.

Files and folders

 1empty_trash.php --username superuser --days 30

Permanently removes items deleted more than 30 days ago from the trash of the account superuser. Without --username it applies to every account; without --days it removes everything in the trash.

 1delete_old_files.php 2592000 admin confirm

Deletes old files from users' home folders. See Deleting old files.

 1make_thumbs.php --username superuser

Generates the missing thumbnails for the files in that account's home folder. Without --username it processes every account. Existing thumbnails are not regenerated.

 1make_thumbs.php --username superuser --size large

The same, but generates high resolution previews instead of thumbnails. --size takes small, medium or large.

--path=/full/disk/path processes one folder instead of an account's home folder, and --debug=true prints the options in use and the details of each conversion.

 1folder_sizes_rescan.php --all

Recalculates the cached folder sizes from what is actually on disk. FileRun keeps these so that storage quotas and the folder sizes shown in the file list do not have to be counted on every request. --all covers every account's home folder; --uid=123 covers one account's; --path=/full/disk/path covers a single folder. Running it with no option prints this list.

 1paths_cleanup.php

Removes the database records of files and folders that are no longer on disk. --deep compares every record instead of stopping early, --aggressive also examines items FileRun excludes, --remove-hidden also looks inside hidden items, and --path=/full/disk/path limits the work to one folder. The daily maintenance already runs this with --deep.

Metadata

 1metadata_update_file_type.php "/path/to/folder-or-file/"

Assigns the FileRun metadata file type (marks files as Photo, Audio, Document and so on) and extracts the metadata that goes with each type, for the file or folder at the given path. For folders holding more than 10,000 files, use the command below instead.

 1metadata_index.php superuser "/full/path/to/subfolder/"

The same, applied to the home folder of the account superuser. Without a username it processes every account's home folder. The path is optional and limits the work to that subfolder.

 1process_metadata_extraction_queue.php

Processes the queue of files waiting for their metadata to be read. This is what everyMinute.php runs; use it directly to work through a backlog. Only one copy runs at a time.

Search indexing

These apply to the full-text search, which indexes the contents of files. See File indexing.

 1add_file_to_search_index.php "/full/path/to/file.ext"

Indexes the contents of one file.

 1add_folder_to_search_index.php "/full/path/to/folder/"

Indexes the contents of every file inside a folder, including its subfolders.

 1reindex_files.php superuser

Re-indexes the contents of the files in that account's home folder, removing from the index the entries whose files are gone. Without a username it processes every account.

 1process_search_index_queue.php

Works through the queue of indexing operations. See File indexing.

 1index_filenames.php /path/to/folder/ true

Records the names of the files inside the given folder in FileRun's database, so that files placed there outside FileRun appear in the file name search. The optional second argument true suppresses the listing of every file, which can be very long.

Repair

 1db_update.php

Runs the database migrations of the installed version again. Every migration is written so that running it twice is safe, so this repairs a database structure that has drifted. It is not a way to complete a pending software update — the control panel does that. The control panel's Software update page has a Repair database button that does the same.