Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Support

How to auto-backup and auto update?

Started by Marco 6 years ago · 3 replies · 770 views
6 years ago

Hi, I hope the day is going well!
I have different Grav installations and want automate auto-update of grav and plugins but before update is lunched want to perform a backup.

If I have about 5 different website to update how can I do automatically with a cronjob?
Can I create a .sh script that made a backup and update when update is available?

Or maybe need auto-backup once a week and have an auto update scheduled?

Thanks in advance for the help.

Marco

6 years ago

You could do this with a cronjob that runs a shell-script, there should be plenty of applicable tutorials online relevant for the server you run Grav on. You can also follow the tutorial in the docs on how to use Deployer to do this, which also lets you do it remotely.

One thing to keep in mind though, is that you generally only want automatic backups, not updates. Updates to Grav Core and extensions should almost always be tested before going into production, because it's hard to foresee what the changes can mean for your installation.

6 years ago

Thanks for the reply!
The docs explain how to upgrade using Deployer. I don't wanna install things and I'm asking if there are a solution like in WordPress that now are able to auto update plugins ans core also.

WordPress on my install never require a cron but if I will find a way to create a .sh script with right command to run backup than update will be the solution.

You could do this with a cronjob that runs a shell-script, there should be plenty of applicable tutorials online relevant for the server you run Grav on.

Before asking here I have already try to Google for a solution but never find useful inf'os for Grav.

6 years ago

Backups via the Grav Scheduler are described in detail here.
The CLI command method is also described there and can be used with cron.
Updates can also be done from the command line, see here.
I'm not sure if this will also work with automatic confirmation (answer yes to all questions) though.
but, as @OleVik already stated: automatic update can be problematic.

Suggested topics

Topic Participants Replies Views Activity
Support · by Thomas, 1 week ago
2 50 6 hours ago
Support · by Anna, 2 days ago
2 58 9 hours ago
Support · by Justin Young, 10 hours ago
1 28 10 hours ago
Support · by Duc , 1 week ago
2 63 5 days ago
Support · by Colin Hume, 1 week ago
2 53 5 days ago