Nextcloud自动清理回收站_nextcloud回收站自动清理-程序员宅基地

技术标签: 服务器  

Nextcloud自动清理回收站

注意,本文Nextcloud为snap安装的,如果是手动安装也不会麻烦那么多了。然后也没有添加www-data这样的用户对应该Nextcloud的权限,全是管理员权限,如和您安装的方式与设置不一样导致其它bug也是没办法的事。本文仅作自留档,毕竟已经折腾Nextcloud两次了。

首先是如果想手动清空的话,比如以下命令清空所有用户的回收站

sudo nextcloud.occ trashbin:cleanup -all-users

但如果要自动清除呢?以下参考https://www.shenqhy.com/nextcloud-clear-files_trashbin.html

博主的Nextcloud数据放在阿里的NAS下,突发奇想在阿里云手机客户端上查看了下用量,1.5个G,不科学啊。
进入NAS挂载目录,du逐层排查,发现是某账户文件夹下的files_trashbin文件夹占用了1.3个G
天天手动清理不累死
谷歌查找自动清理方法,在Nextcloud文档中发现,通过修改trashbin_retention_obligation参数为'auto,D'可自动清理超过D天的trashbin
遂添加

'trashbin_retention_obligation' => 'auto,3',

auto,3即为超过3天自动清理

保存后等待下一次Cron生效

转载请注明:神奇海域 » Nextcloud清理files_trashbin

官方文档对应部分如下:

Configuration Parameters

Nextcloud uses the config/config.php file to control server operations. config/config.sample.php lists all the configurable parameters within Nextcloud, along with example or default values. This document provides a more detailed reference. Most options are configurable on your Admin page, so it is usually not necessary to edit config/config.php.

Note

The installer creates a configuration containing the essential parameters. Only manually add configuration parameters to config/config.php if you need to use a special value for a parameter. Do not copy everything from config/config.sample.php . Only enter the parameters you wish to modify!

Deleted Items (trash bin)

These parameters control the Deleted files app.

'trashbin_retention_obligation' => 'auto',

If the trash bin app is enabled (default), this setting defines the policy for when files and folders in the trash bin will be permanently deleted.

The app allows for two settings, a minimum time for trash bin retention, and a maximum time for trash bin retention. Minimum time is the number of days a file will be kept, after which it may be deleted. Maximum time is the number of days at which it is guaranteed to be deleted. Both minimum and maximum times can be set together to explicitly define file and folder deletion. For migration purposes, this setting is installed initially set to “auto”, which is equivalent to the default setting in Nextcloud.

Available values:

    • auto

      default setting. keeps files and folders in the trash bin for 30 days and automatically deletes anytime after that if space is needed (note: files may not be deleted if space is not needed).

    • D, auto

      keeps files and folders in the trash bin for D+ days, delete anytime if space needed (note: files may not be deleted if space is not needed)

    • auto, D

      delete all files in the trash bin that are older than D days automatically, delete other files anytime if space needed

    • D1, D2

      keep files and folders in the trash bin for at least D1 days and delete when exceeds D2 days (note: files will not be deleted automatically if space is needed)

    • disabled

      trash bin auto clean disabled, files and folders will be kept forever

Defaults to auto

当然,我本来也想用nextcloud.occ直接配置,但想想可能会有奇怪的bug,还是直接修改php配置文件吧。自己找是不想找到,查询snap安装版本的Nextcloud的config/config.php的位置:

参考https://help.nextcloud.com/t/how-do-i-edit-the-config-php-file-on-a-nextcloud-box/12217/3中用户dev0的回答

dev0

May '17

Unfotunately that isn’t so easy in the ncbox as its installed with snap

i suggest you check the snap command on ssh

first do a snap list so you see which packages are installed

with snap refresh you can update your stuff but if you do that with nextcloud and the gap is too big, it will crash.

with snap info nextcloud you see the available commands:

  • nextcloud.disable-https
  • nextcloud.enable-https
  • nextcloud.manual-install
  • nextcloud.mysql-client
  • nextcloud.mysqldump
  • nextcloud.occ

i suggest you use the snap command to enable https because its better if its register that to the packet manager.

I have installed:

installed: 11.0.3snap1 (1288) 162MB -

so my config file which is applies should be this:

/var/snap/nextcloud/1288/nextcloud/config/config.php

there you can add the domain.

那好办,直接去我的/var/snap/nextcloud/current/nextcloud/config/config.php里修改就行。即添加'trashbin_retention_obligation' => 'auto,3',这一行,一般原来是没有这个配置的。


引用鸣谢:

  1. 神奇海域 » Nextcloud清理files_trashbin
  2. Nextcloud文档
  3. https://help.nextcloud.com/t/how-do-i-edit-the-config-php-file-on-a-nextcloud-box/12217/3
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/weixin_43598457/article/details/117367623

智能推荐

PC移植安卓---2018/04/26_电脑软件移植安卓-程序员宅基地

文章浏览阅读2.4k次。记录一下碰到的问题:1.Assetbundle加载问题: 原PC打包后的AssetBundle导入安卓工程后,加载会出问题。同时工程打包APK时,StreamingAssets中不能有中文。解决方案: (1).加入PinYinConvert类,用于将中文转换为拼音(多音字可能会出错,例如空调转换为KongDiao||阿拉伯数字不支持,如Ⅰ、Ⅱ、Ⅲ、Ⅳ(IIII)、Ⅴ、Ⅵ、Ⅶ、Ⅷ、Ⅸ、Ⅹ..._电脑软件移植安卓

学习笔记(03):高并发下的Nginx性能优化实战-Nginx优势特点总结-程序员宅基地

文章浏览阅读87次。 高并发下的Nginx性能优化实战、解读Nginx的核心知识、掌握nginx核心原理?通过本期课程将解答我们的疑惑。_随着 nginx 发展,高并发、轻量的优势,近几年

Linux环境 docker启动redis命令_linux docker 重启 redis-程序员宅基地

文章浏览阅读1.1k次。docker启动redis命令_linux docker 重启 redis

【总结】插头DP-bzoj1210/2310/2331/2595_dp插头模型-程序员宅基地

文章浏览阅读325次。插头DP小结_dp插头模型

关于测试工作效率低的一些思考和改进方法_测试人员不足与改进-程序员宅基地

文章浏览阅读3.5k次。关于测试工作效率低的一些思考和改进方法引子  汇总统计了一下项目组近期测试项目实际工作量与基线工作量的对比,发现一个严重问题。就是工作效率特别低下。下面简单列举一下几个项目预期工作量和实际工作量以及时间耗费严重的地方、项目简要背景。  1、B版本测试。版本预期工作量15人天,实际耗费工作量在30人天。更为严重的是测试人员并没有因为测试周期延长和工作量投入加大而测试的更轻松,反而是测试期..._测试人员不足与改进

级联样式表_级联样式表| 第三部分-程序员宅基地

文章浏览阅读173次。级联样式表 CSS-难以成熟 (CSS — Difficult to maturation)Unlike software, the CSS specifications are developed by successive versions, which would allow a browser to refer to a particular version. CSS was devel..._级联样式表是哪年产生的

随便推点

NumPy科学数学库_数学中常用的环境有numpy-程序员宅基地

文章浏览阅读101次。NumPy是Python中最常用的科学数学计算库之一,它提供了高效的多维数组对象以及对这些数组进行操作的函数NumPy的核心是ndarray(N-dimensional array)对象,它是一个用于存储同类型数据的多维数组Numpy通常与SciPy(Scientific Python)和 Matplotlib(绘图库)一起使用,用于替代MatLabSciPy是一个开源的Python算法库和数学工具包;Matplotlib是Python语言及其Numpy的可视化操作界面'''_数学中常用的环境有numpy

dind(docker in docker)学习-程序员宅基地

文章浏览阅读1.1w次。docker in docker说白了,就是在docker容器内启动一个docker daemon,对外提供服务。优点在于:镜像和容器都在一个隔离的环境,保持操作者的干净环境。想到了再补充 :)一:低版本启动及访问启动1.12.6-dinddocker run --privileged -d --name mydocker docker:1.12.6-dind在其他容器访问d..._dind

com.sun.org.apache.xerces.internal.dom.DeferredTextImpl cannot be cast to org.w3c.dom.Element-程序员宅基地

文章浏览阅读1.4k次。代码 List<book> list = new ArrayList<book>(); Document doc = new DOCUntil().getDocument("src/ww/t/qp/books.xml"); Element root = doc.getDocumentElement(); NodeList books = root.getElementsByTagName("book"); for _com.sun.org.apache.xerces.internal.dom.deferredtextimpl cannot be cast to or

计算机网络 (ISP、计算机网络体系结构 拓扑图)-程序员宅基地

文章浏览阅读2.9k次。计算机网络定义: 一些互相连接的,自治的计算机或者智能硬件设备集合信息是如何交换的?1、电路交换(电话)线路被某个终端占用后不会被释放 除非主动释放2、分组交换分组交换是 把大数据拆分成小数据进行分组传输 提高传输效率计算机上的数据是突发的,所以不采用电路交换,而采用分组交换3、ISP(internet service provider)网络服务提供商终端通过交换机连接一级ISP(国际性区域)之间互相连接 某一条线路断后可以通过其他设备进行通信二级ISP(国家/区域性规模)与一级相互连接三级ISP(本地区域

集通字库芯片GT20L16S1Y 读取字体数据-程序员宅基地

文章浏览阅读3.5k次,点赞12次,收藏46次。/** * @brief * @note * @param None * @retval None * @author PWH * @date 2021/4 */int32_t GT20L16S1Y_Get_Addr_Ascii_7x8(char *asciiCode){ if (*asciiCode >= ' ' && *asciiCode <= '~') { return 0x66C0 + (*asciiCode - ._gt20l16s1y

关于ETH的NONCE_ethers获取交易nonce-程序员宅基地

文章浏览阅读1.3k次。最近我的ETH交易里面出现了一种情况,交易虽然返回了hash,但是却迟迟未被确认,连在区块浏览器上也找不到对应的pending交易, 但是通过节点api调用hash获取记忆记录却有数据返回。这种情况问了人也查了资料,最后得出的结果是,交易可能在矿池,但是却没有被矿工打包。于是想到了imtoken钱包的加速交易内容。说到加速交易,不得不说的就是ETH交易内重要的一个内容, nonce。nonc..._ethers获取交易nonce

推荐文章

热门文章

相关标签