I would like to move folders around server-sided (based on some parameters from a SQL database).
What would be the easiest practice to do so? I have a user with all rights to the datafolder. The script will run local on the same machine. For simplification, I am following the following steps:
List directories
Determine desired target location (based on MySQL db).
Move the folder
The first 2 steps are easily done. But for the last step I am struggling. I can move it local and rescan, but that’s not ideal. I hope anyone can point me in the right direction.
I would use a command-line WebDAV client like cadaver for this purpose. This way, the folders new location will be known immediately, without a rescan. You could run cadaver with a script created by the first two steps.
It would be ideal if I could move folders programmatically on demand in a clean way via a PHP script without accessing the filesystem directly for safety reasons. This can be 1 folder in a day, but also many folders in a minute. I think it is better/safer that ownCloud will handle the movings. Please correct me if I’m wrong!