exp:contentcheck
Content checks: build the reference index, list the unused assets and the broken relations below a node, list the missing files, scan the storage files (report only; --fix, --quarantine and --fix-permissions are a dry run unless --apply).
Script bin/php/contentcheck.php, code in kernel/private/classes/commands/contentcheck.php. Run it from the installation root, as the user the web server runs as:
./console exp:contentcheck --help
./console exp:content-check --help
php bin/php/contentcheck.php --helpHelp text
Content checks (report only; --fix, --quarantine and --fix-permissions are a dry run unless --apply)
./console exp:content-check --build-index build the reference index (also the cronjob part contentcheck)
./console exp:content-check --unreferenced --node=2 the unused assets below node 2
./console exp:content-check --broken --node=2 the broken relations below node 2, and the layouts'
./console exp:content-check --why=123,456 what uses objects 123 and 456
./console exp:content-check --storage scan the storage files: orphans and file problems
./console exp:content-check --storage --quarantine which orphans would be quarantined
./console exp:content-check --storage --quarantine --apply move them to the quarantine
./console exp:content-check --storage --fix-permissions [--apply] set owner and mode of used files
./console exp:content-check --missing-files --node=2 files missing from the storage, stale image aliases
./console exp:content-check --missing-files --fix=regenerate what regenerating would do
./console exp:content-check --fix=restore --items=123-4,125-2 --apply restore two field versions
./console exp:content-check --fix=replace --items=123-4 --replace-with=photo.jpg --apply
--fix (regenerate, restore, replace, remove, review), --quarantine and --fix-permissions are the only
options that change anything, and only with --apply: without it they show the plan and change nothing.
--dry-run means the same as no --apply; --apply together with --dry-run is a usage error (exit 2).
Without --items --fix takes every finding of --missing-files.
The lists are those of the user given by --login (default admin): what that user may read.
Exit code: 0 nothing found, 1 something found, 2 error.Options
| Option | Value | Help |
|---|---|---|
--build-index | Build the reference index and keep it in the cache | |
--unreferenced | List the unused assets below --node | |
--broken | List the broken relations below --node (all pages) and in the layouts | |
--missing-files | List the fields below --node whose files are missing, and images with missing or stale aliases | |
--problems | required | With --missing-files: missing,alias_missing,alias_stale,alias_absent (default: the first three) |
--versions | required | With --missing-files: published,draft (default: both) |
--fix | required | Resolve: regenerate, restore, replace, remove or review (the findings of --missing-files, or --items) |
--items | required | With --fix: field versions as <attribute id>-<version>, separated by commas |
--replace-with | required | With --fix=replace: the file put at the expected path (one item) |
--node | required | The node the lists start from (default: content.ini [NodeSettings] RootNode) |
--why | required | Object ids: say what uses each of them |
--login | required | The user whose access the lists use (default admin) |
--json | One JSON object instead of the text | |
--storage | Scan the storage files (all of it, in batches) and keep the result for the storage view | |
--quarantine | With --storage: move the orphan files of the scan to the quarantine (each checked again) | |
--fix-permissions | With --storage: set the expected owner and mode of used files with a wrong one | |
--apply | With --fix, --quarantine or --fix-permissions: do it (the default is a dry run that shows the plan) | |
--dry-run | The default, kept for scripts that pass it: show what would be done, change nothing |
Read from the option definitions in the code (startup(), getOptions(), options() or ezcConsoleOption). Every script also takes the standard options of the script framework (--help, --siteaccess, --debug, --quiet, --allow-root-user ...).
Related
Generated by ./console exp:help:examples from bin/php/contentcheck.php, kernel/private/classes/commands/contentcheck.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.