1
1
Fork
You've already forked system-cli
0

Feature request - Backup before update flag #13

Open
opened 2023年07月24日 23:35:21 +02:00 by slimninja · 2 comments
slimninja commented 2023年07月24日 23:35:21 +02:00 (Migrated from github.com)
Copy link

Hi. First of all, great work on everything. I've been using Bookstack since about 2017 with very few issues :)

I currently run a script monthly via cron that:

  1. Check git repo to see if I'm behind (and if so)
  2. Backs up db/files
  3. Updates BookStack
  4. Sends me a notification of update/status

With system-cli, life is a little easier, and I can run something along the lines of this every month:

./BookStack/bookstack-system-cli backup backups/
./BookStack/bookstack-system-cli update

However, this means that regardless of whether there's a bookstack update available or not, my instance is backed up.

Ideally I would be able to run something like below, where If I provide a flag, e.g. --backup, bookstack would backup before it updates to the backup path provided (else default backup path)

./BookStack/bookstack-system-cli update --backup backups/

That way, this can be a defined as a standalone cron task

Additionally, I noticed that even if you are on the latest version of Bookstack and run update, you receive a "Your BookStack instance at [path/BookStack] has been updated!". It would be great if this returned a "Your BookStack instance is already on the latest version" instead.

Hi. First of all, great work on everything. I've been using Bookstack since about 2017 with very few issues :) I currently run a script monthly via cron that: 1. Check git repo to see if I'm behind (and if so) 2. Backs up db/files 3. Updates BookStack 4. Sends me a notification of update/status With system-cli, life is a little easier, and I can run something along the lines of this every month: ``` ./BookStack/bookstack-system-cli backup backups/ ./BookStack/bookstack-system-cli update ``` However, this means that regardless of whether there's a bookstack update available or not, my instance is backed up. Ideally I would be able to run something like below, where If I provide a flag, e.g. --backup, bookstack would backup before it updates to the backup path provided (else default backup path) ``` ./BookStack/bookstack-system-cli update --backup backups/ ``` That way, this can be a defined as a standalone cron task Additionally, I noticed that even if you are on the latest version of Bookstack and run update, you receive a "Your BookStack instance at [path/BookStack] has been updated!". It would be great if this returned a "Your BookStack instance is already on the latest version" instead.
ssddanbrown commented 2023年07月25日 12:15:09 +02:00 (Migrated from github.com)
Copy link

Thanks for the suggestion @slimninja.
Personally, I'm not too fond of this due to the added complexity of supporting the merging two commands, each with their own options. I really want to try to keep things simple in this CLI, with specific commands for specific jobs.
I can understand the scenario/need though.

Maybe we can come at this from a different angle though, and look to implement a check-update command (or similar), that returns a status code depending on if there's an update or not.
That way you'd be able to do something like:

./bookstack-system-cli check-update && ./bookstack-system-cli backup backups/ && ./bookstack-system-cli update
Thanks for the suggestion @slimninja. Personally, I'm not too fond of this due to the added complexity of supporting the merging two commands, each with their own options. I really want to try to keep things simple in this CLI, with specific commands for specific jobs. I can understand the scenario/need though. Maybe we can come at this from a different angle though, and look to implement a `check-update` command (or similar), that returns a status code depending on if there's an update or not. That way you'd be able to do something like: ```bash ./bookstack-system-cli check-update && ./bookstack-system-cli backup backups/ && ./bookstack-system-cli update ```
slimninja commented 2023年07月25日 13:49:45 +02:00 (Migrated from github.com)
Copy link

Thanks for the suggestion @slimninja.
Personally, I'm not too fond of this due to the added complexity of supporting the merging two commands, each with their own options. I really want to try to keep things simple in this CLI, with specific commands for specific jobs.
I can understand the scenario/need though.

Maybe we can come at this from a different angle though, and look to implement a check-update command (or similar), that returns a status code depending on if there's an update or not.
That way you'd be able to do something like:

./bookstack-system-cli check-update && ./bookstack-system-cli backup backups/ && ./bookstack-system-cli update

That's a great idea, and solves my initial problem as well. Reduces overlap as well

> Thanks for the suggestion @slimninja. > Personally, I'm not too fond of this due to the added complexity of supporting the merging two commands, each with their own options. I really want to try to keep things simple in this CLI, with specific commands for specific jobs. > I can understand the scenario/need though. > > Maybe we can come at this from a different angle though, and look to implement a `check-update` command (or similar), that returns a status code depending on if there's an update or not. > That way you'd be able to do something like: > > ```bash > ./bookstack-system-cli check-update && ./bookstack-system-cli backup backups/ && ./bookstack-system-cli update > ``` That's a great idea, and solves my initial problem as well. Reduces overlap as well
Sign in to join this conversation.
No Branch/Tag specified
main
22-mysql-cred-escaping
No results found.
No labels
Bug
Feature Addition
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
bookstack/system-cli#13
Reference in a new issue
bookstack/system-cli
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?