Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow non-interactive running of bookstack:cleanup-images command #4541

Closed
2 tasks done
tipuraneo opened this issue Sep 13, 2023 · 2 comments
Closed
2 tasks done

Allow non-interactive running of bookstack:cleanup-images command #4541

tipuraneo opened this issue Sep 13, 2023 · 2 comments

Comments

@tipuraneo
Copy link

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • I have searched GitHub for the issue.

Describe the Scenario

Hello, I am trying to to automate cleanup of unused images. According to the documentation
https://www.bookstackapp.com/docs/admin/commands/#cleanup-unused-images
and the help command

root@bookstack:/var/www/bookstack# php artisan bookstack:cleanup-images --help
Description:
  Cleanup images and drawings

Usage:
  bookstack:cleanup-images [options]

Options:
  -a, --all             Also delete images that are only used in old revisions
  -f, --force           Actually run the deletions, Defaults to a dry-run
  -h, --help            Display help for the given command. When no command is given display help for the list command
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi|--no-ansi  Force (or disable --no-ansi) ANSI output
  -n, --no-interaction  Do not ask any interactive question
      --env[=ENV]       The environment the command should run under
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug`

this should be

root@bookstack:/var/www/bookstack# php artisan bookstack:cleanup-images --all --force --no-interaction

But it endet up without any useful output no with cleaned up unused images:

root@bookstack:/var/www/bookstack# php artisan bookstack:cleanup-images --all --force --no-interaction
This operation is destructive and is not guaranteed to be fully accurate.
Ensure you have a backup of your images.

root@bookstack:/var/www/bookstack#

How can I automate it?
Kind Regards

Exact BookStack Version

23.08.02

Log Content

No response

Hosting Environment

root@bookstack:/var/www/bookstack# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.2 LTS
Release:        22.04
Codename:       jammy
@ssddanbrown
Copy link
Member

Hi @tipuraneo,
Looks like we're not properly supporting --no-interaction along with the --force option.
I'll recategorize this as a bug to be fixed for the next feature release.

@ssddanbrown ssddanbrown changed the title how to automate cleanup of unused images Allow non-interactive running of bookstack:cleanup-images command Sep 14, 2023
@ssddanbrown
Copy link
Member

I've now addressed this within dfaf6f7, including a test to cover, which will be part of the next feature release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants