Youth Age-Up Command
This guide explains the age_up_members CakePHP CLI command that automatically transitions youth member accounts to adult status when they reach age 18.
π― Purpose
- Detects members whose
birth_monthandbirth_yearindicate they are 18+.- Only members whose 18th birthday falls in the current year up through the current month are evaluated, keeping the runtime focused on imminent age-ups.
- Converts minor statuses to the correct adult equivalents:
"unverified minor"or"< 18 parent verified"β"active""verified < 18"or"< 18 member verified"β"verified"
- Clears
parent_idlinks so the adult account stands alone. - Sets
modified_by = 1(super user) on all persisted changes for audit traceability.
π§± Prerequisites
- Accurate
birth_month/birth_yearvalues populated for youth members. - Member statuses maintained via the constants in
\App\Model\Entity\Member. - CLI user with permission to write
app/logs/and execute Cake commands.
π Running the Command
Manual Execution
# Dry run β review changes without persisting them
bin/cake age_up_members --dry-run
# Execute transition and save updates
bin/cake age_up_members
Using the Generic Cron Wrapper
bash /home/vscribe/cronJobScripts/runCakeCommand.sh \
--workdir /home/vscribe/amp-prod.ansteorra.org \
age_up_members
Add --dry-run or --php-bin options to the wrapper as needed.
Cron Example (DreamHost Style)
0 2 * * * /usr/bin/setlock -n /tmp/cronlock.vscribe-AMP_UAT_AgeUp \
sh -c 'bash /home/vscribe/cronJobScripts/runCakeCommand.sh \
--workdir /home/vscribe/amp-uat.ansteorra.org \
age_up_members --dry-run'
π Output Summary
- Displays number of youth members evaluated.
- Reports how many records require updates and the adult status applied.
- Indicates failures when the command cannot save an entity (non-zero exit code in that case).
π Troubleshooting Tips
- Confirm the memberβs
agevirtual field (calculated from birth month/year) reflects 18+. - Ensure the CLI user has permission to update
Members.modified_by. - Run with
--dry-runto verify counts before enabling the cron job.
π Related References
app/src/Command/AgeUpMembersCommand.phpapp/src/Model/Entity/Member::ageUpReview()cronScripts/runCakeCommand.sh- Member Lifecycle Documentation