I am trying to run a script that will run every 5 minutes in a shared hostings wordpress folder that will rename the newest CSV file in that folder.


I tried putting a js file in the folder within that folder and run it.

var fs = require('fs');

function runClear() 
    fs.readdir("", (err, files) => {
      files.forEach(file => {

setInterval(runClear, 300*1000);

However, it seems like I got client side and server side scripting confused. It seems like I need node.js.

What would be the best approach for this?


Read more here: Renaming files in a wordpress folder via jquery / jscript


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: