diff --git a/README.md b/README.md
index 6916ba9..8e017bc 100644
--- a/README.md
+++ b/README.md
@@ -111,6 +111,10 @@ and `avatar.url = https://avatar-cache.your-nextcloud.com/`:
For additional security, we recommend to disable directory listing, symlinks and
any language interpreter such as php for the cache directory.
+Cached avatars are usually deleted as soon as the meeting ends. In cases the BBB
+server shuts down unexpected, we provide the `bbb:clear-avatar-cache` occ
+command (example use: `./occ bbb:clear-avatar-cache`).
+
## :bowtie: User guide
diff --git a/appinfo/info.xml b/appinfo/info.xml
index c0b640a..178c9d2 100644
--- a/appinfo/info.xml
+++ b/appinfo/info.xml
@@ -45,6 +45,9 @@ Developer wanted! If you have time it would be awesome if you could help to enha
SimpleXML
+
+ OCA\BigBlueButton\Command\ClearAvatarCache
+
OCA\BigBlueButton\Settings\Admin
OCA\BigBlueButton\Settings\Section
diff --git a/lib/Command/ClearAvatarCache.php b/lib/Command/ClearAvatarCache.php
new file mode 100644
index 0000000..aa743d9
--- /dev/null
+++ b/lib/Command/ClearAvatarCache.php
@@ -0,0 +1,36 @@
+avatarRepository = $avatarRepository;
+ }
+
+ protected function configure() {
+ $this->setName('bbb:clear-avatar-cache');
+ $this->setDescription('Clear all avatars in cache');
+ }
+
+ protected function execute(InputInterface $input, OutputInterface $output) {
+ $stats = $this->avatarRepository->clearAllRooms();
+
+ $output->writeln("Removed " . $stats["files"] . " avatars in " . $stats["rooms"] . " rooms");
+
+ return 0;
+ }
+}