diff options
Diffstat (limited to 'bin/ncp/TOOLS/nc-previews.sh')
-rw-r--r-- | bin/ncp/TOOLS/nc-previews.sh | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/bin/ncp/TOOLS/nc-previews.sh b/bin/ncp/TOOLS/nc-previews.sh index 97388eb0..60296686 100644 --- a/bin/ncp/TOOLS/nc-previews.sh +++ b/bin/ncp/TOOLS/nc-previews.sh @@ -11,7 +11,21 @@ configure() { - sudo -u www-data php /var/www/nextcloud/occ preview:generate-all + [[ "$CLEAN" == "yes" ]] && { + local datadir + datadir=$( ncc config:system:get datadirectory ) || { + echo "data dir not found"; + return 1; + } + + rm -r "$datadir"/appdata_*/preview/* &>/dev/null + mysql nextcloud <<<"delete from oc_filecache where path like \"appdata_%/preview/%\"" + ncc files:scan-app-data -n + } + + [[ "$INCREMENTAL" == "yes" ]] && { ncc preview:pre-generate -n -vvv; return $?; } + + ncc preview:generate-all -n -v -p "$PATH1" } install() { :; } |