Auto Delete Old Files

Server configuration
Operating system:OS6, running on NetGear ReadyNAS device
Web server:https://192.168.0.7/owncloud/
Database:SQLlite
PHP version: Unknown
ownCloud version 9.1.3
fresh install:

I have set up Owncloud on my personal NAS device to receive daily backup files from my remote webhost, probably via ftp, as it seems webDav is disabled by design for my shared web hosting account
I need a way for these incoming files not to build up indefinitely, as they will quickly fill my NAS hard drive, but for only the most recent 5 files (for example) to remain. Each new backup file from the webhost has a unique filename, so from my reading, I don't think they can be managed and auto deleted by the OC built -in 'Version' app.

I have no knowledge of scripting or linux, and I cannot enable ssh (apparently a requirement to use cron on the NAS) without voiding my Netgear support anyway, (and I cannot enable it on the shared web host either, for that matter)

I just need a simple old files auto deletion solution that will make instant sense to me or anyone else with limited computer skill and who needs to set up and manage settings etc

You can have a look here:

The branch for version 10.0 should be compatible with OC 9.1.

Thanks tflidd! I will follow this up

Sorry to be such a noob, but how would I install this app on my ReadyNAS device? I have no direct access or way to edit OC configuration files, and it looks like I can install OC apps within the OC user interface only if they are listed in the OC app store.

If you want it to be on the app store, you would need to create an official fork for owncloud, make the modifications and publish the app on the owncloud app store. That would be the best solution as more people could benefit from this app.

You can download the NC 10 release from here: https://github.com/nextcloud/files_retention/releases. You need to put extract this folder into you apps/ folder. Make sure the folder name corresponds to the app-name (files_retention). After that the app should show up in your app menu (category not enabled).

Thanks tflidd. Unfortunately I have no way to see or access the apps/ folder for OC or any other installed software - I believe by design there is no access to system files at all on ReadyNAS without enabling SSH. Enabling SSH would make me ineligible for support from the manufacturer if anything went wrong with the device.
I briefly looked at the offical forking=>appstore option as a way to avoid the manual installation issue , but do not see what the modifications are that I would need to make (I am not a programmer and don't want to mess anyone else up who might install this), or how to achieve publication of the result on the Owncloud app store anyway. Reading the OC documentation, getting an app published there requires some sort of approval process and that you are a trusted developer - something I am not likely to qualify as.

I also looked at replacing OwnCloud with NextCloud on the ReadyNAS (so I can install the files_retention app automatically), but again am stymied by lack of an officially supported NextCloud app for that platform, and no way to install manually.

Assuming you could pass muster as a 'trusted developer', would it be possible to get you to create & publish the forked app version for OwnCloud 9?

That would probably be necessary. Perhaps there are different ways to access the storage which is used by an app. But I don't know this operating system.

If you are forking such a thing, you should also maintain this software. This requires a bit of knowledge and time.

Other idea: Get an ARM device where you have full access and use your NAS as external storage. This way you have full flexibility (files shouldn't be larger than 2 GB because 32-bit php only supports this file size).

Managed to get the files_retention app installed in OwnCloud (with outside help), though I have not been able to find any additional controls or options, nor any documentation explaining its use. Can anyone advise how this app is used?

Installation steps (for any other noobs who come this way, and who know nothing of Linux etc) was as below:

  1. Download and open Putty http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

  2. Login via ssh (username: root, password: admin password)

  3. Go to the ReadyNas + owncloud directory ---> apps

cd /apps/owncloud/web/apps

  1. Download the files retention plugin, then unzup it, then rename it:

wget https://github.com/nextcloud/files_retention/archive/master.zip
unzip master.zip
mv files_retention-master files_retention

  1. Set the appropriate permissions and stuff:

chown -R admin files_retention
chgrp -R admin files_retention
chmod 755 files_retention

  1. Cleanup:

rm master.zip

1 Like

Normally, I would accept the controls on the admin page. I only found this announcement (https://nextcloud.com/workflow/) which made me suspect that it could be required to install file access control as well. But you should consider asking someone with more insight before investing much more time.

I tried an installation of NextCloud on a webserver, then installed the files_retention app into that.

Strangely even in NextCloud there was no obvious change or addition in funtionality that I could find - and with no user documentation at all, and no one out there responding to my query on the NextCloud forum, I am all out of ideas.

Just had a quick look, you probably need the file access control and automatic tagging feature as well (https://docs.nextcloud.com/server/10/admin_manual/configuration_files/files_access_control.html).

For any Nextcloud-related problems, please contact their community.