It would probably be easier to use --root--root
and --uri--uri
instead of @main@main
. Drush loads aliases on a per-user basis; the user you are testing drush @main elysia-cron
probably has the @main@main
alias defined in an alias file in ~/.drush~/.drush
. You'd need to either move your aliases to a global location, or perhaps copy your alias file to the www-data user's .drush.drush
folder.