From 4a0002cc2b395262b2744001ebc8f57914f1de89 Mon Sep 17 00:00:00 2001 From: Christoph Date: Fri, 12 Sep 2025 21:45:03 -0300 Subject: [PATCH] stash cron --- .gitignore | 4 +++- stash/cron/15min/scan.sh | 15 +++++++++++++++ stash/docker-compose.yml | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 stash/cron/15min/scan.sh diff --git a/.gitignore b/.gitignore index 63f82bc..5522649 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,6 @@ !*/.*env* !qbittorrent/config/qBittorrent/*.conf -!qbittorrent/config/qBittorrent/*.json \ No newline at end of file +!qbittorrent/config/qBittorrent/*.json + +!stash/cron/**/* \ No newline at end of file diff --git a/stash/cron/15min/scan.sh b/stash/cron/15min/scan.sh new file mode 100644 index 0000000..cd9d996 --- /dev/null +++ b/stash/cron/15min/scan.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +# start scan + curl -X POST -H "ApiKey: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOiJjY2FsaWZpY2UiLCJzdWIiOiJBUElLZXkiLCJpYXQiOjE3NDE5NTY3OTN9.UWTnuuWhw0mFNQVWcXCer-NA8IyipxoGx0VieHW7XRQ" \ + -H "Content-Type: application/json" \ + --data '{"operationName":"MetadataScan","variables":{"input":{"scanGenerateCovers":true,"scanGeneratePreviews":true,"scanGenerateImagePreviews":false,"scanGenerateSprites":false,"scanGeneratePhashes":false,"scanGenerateThumbnails":true,"scanGenerateClipPreviews":true}},"query":"mutation MetadataScan($input: ScanMetadataInput!) {\n metadataScan(input: $input)\n}"}' \ + localhost:9999/graphql + + +# clean + + curl -X POST -H "ApiKey: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOiJjY2FsaWZpY2UiLCJzdWIiOiJBUElLZXkiLCJpYXQiOjE3NDE5NTY3OTN9.UWTnuuWhw0mFNQVWcXCer-NA8IyipxoGx0VieHW7XRQ" \ + -H "Content-Type: application/json" \ + --data '{"operationName":"MetadataClean","variables":{"input":{"dryRun":false}},"query":"mutation MetadataClean($input: CleanMetadataInput!) {\n metadataClean(input: $input)\n}"}' \ + localhost:9999/graphql \ No newline at end of file diff --git a/stash/docker-compose.yml b/stash/docker-compose.yml index d365175..0c36b1c 100644 --- a/stash/docker-compose.yml +++ b/stash/docker-compose.yml @@ -31,7 +31,6 @@ services: - ./config:/root/.stash ## Point this at your collection. - /mnt/system:/data - - /mnt/hdd_1tb/data/torrents/xxx:/data/local ## This is where your stash's metadata lives - ./metadata:/metadata ## Any other cache content. @@ -40,3 +39,4 @@ services: - ./blobs:/blobs ## Where to store generated content (screenshots,previews,transcodes,sprites) - ./generated:/generated + - ./cron/15min:/etc/periodic/15min \ No newline at end of file