Deleted files from server > sync local

Hi,

i would like that when we delete files directly from the web server (not since the web version), it deletes in the interface, and on the local directory (computer windows).

Actually, the only solution we have found, is to delete manually files from web interface, but it’s not possible, because we have thousands of files…

Thanks

If I understood correctly you would like to run rm command under shell to delete something in data folder and get update in web and clients. To do this:

  1. run rm and delete whatever you need from the OS shell, e.g. rm -r ...data/user1/files/some_folder/folder_to_be_deleted
  2. run scan of this folder by command sudo -u www-data php occ files:scan --path="user1/files/some_folder"
    After scan completed - folder will not exist any more in web interface and users client.

Question: why to not simply delete shared folder on one of the clients? It will sync with server and other clients.

note, that you should also delete the encryption-keys in case you have enabled local encryption.

I created this script to delete a file and resync the folder:

/usr/local/sbin/nextcloud-rm-file :

#!/bin/bash
# deletes a file and its encryption-keys, then resyncs the folder for NC

# working dir:
cd /pathToNextcloud/volumes/html/data/
#docker-container-id:
D=nextcloud_app_1

if [ "$1" == "" ]; then
        echo no file selected
        exit
fi
rm -iv $1
rm -Rfvi $(echo "$1"|sed s~/files/~/files_encryption/keys/files/~g)
docker exec --user www-data $D php occ files:scan --path=$(dirname "$1")