Is it possible to automatically apply Craft CMS updates when they become available?
At the moment, I have to go into the CPanel and apply updates with the one-click option.
Maybe I can do this with a cron job?
Craft CMS Stack Exchange is a question and answer site for administrators, end users, developers and designers for Craft CMS. It only takes a minute to sign up.Sign up to join this community
Of course you can, but it's going to be a little bit tricky since you have to be logged in or you have to find a way how to login with an automatic request. Like others said, it's a dangerous things and I would not suggest to auto update since something can eventually break and you'll not notice it before your customers.
What you can do is
userservice to login with admin credentials
admin/updates/go/craft<- this will start the update
Making an update for Craft 2 is actually just visiting the
admin/updates/go/craft everything else is automatic
It's typically bad practice to allow auto-updates -- at least in a production environment.
That being said, to update Craft, you're required to download the new files (click "Download" on the update page and it gives you a zip file), and then replace them in your codebase. So right now, no you wouldn't be able to do this with a Cron Job.
Craft 3 may be a different story, though.