I created a separate small flow just to show you. There are two outputs to file nodes. One has msg.test123 which is working fine, second one has global.date_now, which gives an error about missing file path. I could not figure out the error.
Top flow i'm writing into the global variable.
error is this: it says no file.
"Error: ENOENT: no such file or directory, rename 'C:\Users\user\Documents\Osotspa\Database\Osotspa_Report.csv' -> 'C:\Users\user\Documents\Osotspa\Backup\2020077165238.csv'"
Thanks
-Jude
[{"id":"e30f2afe.0e0bb8","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"42ff9f7.7a9696","type":"fs-ops-dir","z":"e30f2afe.0e0bb8","name":"","path":"C:\\Users\\user\\Documents\\Osotspa\\Database\\","pathType":"str","filter":"*","filterType":"str","dir":"files[0]","dirType":"msg","x":340,"y":140,"wires":[["5419519e.7dc8d"]]},{"id":"72b7172b.bcb848","type":"fs-ops-move","z":"e30f2afe.0e0bb8","name":"global.date_now thing","sourcePath":"C:\\Users\\user\\Documents\\Osotspa\\Database\\","sourcePathType":"str","sourceFilename":"files[0]","sourceFilenameType":"msg","destPath":"C:\\Users\\user\\Documents\\Osotspa\\Backup\\","destPathType":"str","destFilename":"date_now","destFilenameType":"global","link":false,"x":680,"y":140,"wires":[[]]},{"id":"9ecc3efd.5b3b7","type":"inject","z":"e30f2afe.0e0bb8","name":"injecting ","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":140,"wires":[["42ff9f7.7a9696"]]},{"id":"1fd45dcf.d39ec2","type":"fs-ops-move","z":"e30f2afe.0e0bb8","name":"msg.test123 thing","sourcePath":"C:\\Users\\user\\Documents\\Osotspa\\Database\\","sourcePathType":"str","sourceFilename":"files[0]","sourceFilenameType":"msg","destPath":"C:\\Users\\user\\Documents\\Osotspa\\Backup\\","destPathType":"str","destFilename":"test123","destFilenameType":"msg","link":false,"x":670,"y":180,"wires":[[]]},{"id":"5419519e.7dc8d","type":"function","z":"e30f2afe.0e0bb8","name":"","func":"msg.test123 = global.get('date_now')+\".csv\";\nreturn msg;\n","outputs":1,"noerr":0,"x":490,"y":140,"wires":[["72b7172b.bcb848","1fd45dcf.d39ec2"]]},{"id":"4dec15a0.cebe2c","type":"inject","z":"e30f2afe.0e0bb8","name":"setting global variable","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":200,"y":80,"wires":[["b26fdb57.82b728"]]},{"id":"b26fdb57.82b728","type":"function","z":"e30f2afe.0e0bb8","name":"rename","func":"var d = new Date();\nvar t = d.getTime();\nvar year = d.getFullYear();\nvar month = d.getMonth()+1; \nif(month.toString().length == 1) {\nmonth = '0'+month;\n}\nvar day = d.getDate();\nvar hour = d.getHours();\nvar min = d.getMinutes();\nvar sec = d.getSeconds();\nmsg.date = t;\n \nglobal.set('date_now', year+month+day+hour+min+sec);\nreturn msg;","outputs":1,"noerr":0,"x":440,"y":80,"wires":[[]]}]