Button or function to automate copy a folder from a template and files and rename it?

I am building a website for online music collaboration project and I like to use a self hosted Nextcloud server to store , share and create new collaborations. To make it possible for musicians from everywhere collaborate with each other.

To keep everything organized for every collaborator. I made a template folder including sub folders and even a sync tone.mp3 file in it. Shared it with the users who are musicians. A folder structure that looks like something like below.

Source: Root\Templates\NewCollab ( This folder name has to be renamed to collab name)

Beside that I created a folder named Collabs and shared that also with the musicians group. ( This becomes the main folder all Collaborations are stored in. )

Destination: Root

                          \Collabs\$Collabnames ( this is the destination of all the above files)

Local i made a very simple powershell script that asks for a new Collaboration name ( Name of song or project the musicians prefer ). Then it makes a copy of all files and folders to the destination. And renames the NewCollab folder to the name of the project chosen.

Is there a way I can create a button in Nextcloud that runs a script on Nextcloud itself doing the same thing? Or if not possible on Nextcloud directly run a script or running a script from another webserver? I have besides Nextcloud also an webserver for hosting a forum in our project.

Its running on Wordpress for now. Nextcloud and Wordpress are running both in same subnet behind a firewall and a reverse proxy. And users can login wordpress using their Nextcloud account.

I don’t want to use any login name or passwords in a script. But use a share on nextcloud doing this.

I’ve found a couple of topics online but there is always an login name and password in a script. Something i really like to avoid.

If someone has other ideas to accomplish let me know. All help is useful in this?

Hi @RichardTrip

I am admin on a nextcloud instance for the music industry as well.

Yes there is.

You need:

  • The “File actions” - files_scripts app:
App-Id files_scripts
App-Name File actions
Summary Scripting tool which allows administrators to expand the file options menu.
Categories files workflow
Repository GitHub - Raudius/files_scripts: Custom file actions app for Nextcloud
Issue-Tracker Issues · Raudius/files_scripts · GitHub
Admin-Doc. files_scripts/docs/README.md at master · Raudius/files_scripts · GitHub
Appstore File actions - Apps - App Store - Nextcloud

  • php-lua module for your php Version:
    For Debian and Ubuntu like OS: (replace “$version” with the php version, e.g 8.2)

Now you can run embedded lua script wich gives you an enormous power. You can use it to simply invoke shell scripts doing any task you want.
Tasks can be added in the contextmenu/three dots of an object (file or folder)

I use it for anything thinkable and possible. WAV/AIFF to mp3 conversion, Markdown to html/pdf, browsing content of compressed files, mounting images,… you name it!

Piece of Cake! :cake:
You will love it!

Much and good luck,

1 Like

Thanks Ernolf!

This is what i needed!! Now time to dive into my programming skills. But this gives me the tools i needed.

This wil help me building this open source website to collaborate with my musician friends. I used Kompoz but too many frustrations using that lately after their big update. And with me many others still very frustrated on there. So now building my own platform . Thankyou again!! You really helped out here! Greetz Richard

1 Like