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'
A script that fails with an error ends with the exit status 1, so that a scheduler or a shell
script can detect the failure. This includes a script that refuses the value of an option, for
example empty_trash.php with "Username not found".
An option that takes a value, such as --username or --days, must have one. When such an option
is the last argument and has no value, the script stops with an error, for example "The option
--username requires a value!", and does nothing. So empty_trash.php --days 30 --username, with the
username missing, empties no trash.
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). It reads only the
files that have a FileRun file type. FileRun gives a file its type when the file is created through
FileRun. For files that were added to the disk outside FileRun, use metadata_update_file_type.php
or metadata_index.php, below.
It also sends the queued e-mail messages, such as the security notices of the accounts and the storage quota warnings. The superuser sees this queue under E-mail → Notices.
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.
Note
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.
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
Warns the accounts that use more than a set percentage of their space quota. The percentage is
Users quota warning level, under Users → Storage usage → Settings in the control
panel. With 0, no warning is sent.
- Each run adds the entry "Space quota warning" to the activity log of each of these accounts.
everyMinute.phpsends the warning e-mail, at most once a week for each account.- For a shared drive, the e-mail goes to the admin of the drive.
--uid=123checks only the account with that ID.
See Warning users before they reach the limit.
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.
Important
The password is an option, not a plain argument:
reset_superuser_pass.php new-passwordis 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 been used for more than the given number of days, and then lists, deactivates or deletes them. Any signed-in activity counts as use: the web interface, WebDAV, the desktop sync app, the mobile apps and the API. An account that was never used counts from the day it was created. The retention settings use the same rule. See Data retention.
The command finds only the accounts of regular users and administrators. It leaves out the superuser, the guest accounts, the shared drives and the accounts that FileRun keeps for its own use.
--action takes one of these values:
listshows each account that was found, with the date of its last activity. An account that is already deactivated is marked[deactivated].deactivatedeactivates the accounts that were found. It skips the accounts that are already deactivated.deletedeletes the accounts that were found, but only the ones that are already deactivated. It refuses an account that is still active, with the message "User account needs to be deactivated first!". So run the command withdeactivatefirst.
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.
1php cli.php 'Drive/!cli/variants/migrate_legacy' --dry-run
Run from the root of the installation. Before 2026.4.0, FileRun kept the thumbnails and the
document previews next to the files, in hidden .filerun.thumbnails and .filerun.cache folders.
This moves what is still valid of them to where FileRun keeps them now, and removes the rest of
those folders. See Updating to 2026.4. With --dry-run it only
prints what it would move and remove. Run it that way first.
--username=superuserlimits the work to the home folder of one account, and--path=/full/disk/pathto one folder. Use--pathfor folders outside the home folders.--delete-onlyremoves the old folders without moving anything. The thumbnails are made again when they are viewed.- Without these options, it processes the home folder of every account, the trash folder set by
$config['path']['trash'], and the folders set by$config['path']['thumbnail_cache']and$config['path']['preview_cache'], if any. - A run that stops can be started again: it continues with what is left. Only one copy runs at a time.
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.