Page 3 of 3

Re: how to start a workflow without looking at existing files

Posted: Tue Jan 01, 2019 12:16 am
by megam
admin wrote: Mon Dec 31, 2018 11:49 pm Manual submitting of files can be done in the FFAStrans Workflow Manager. Just right-click a workflow and select "Submit file(s)". There's also a new web-interface available these days for managing jobs and submitting files: viewtopic.php?f=5&t=789

How big are the folders being monitored? Just asking because the next version will have the option to continously check for changig file size. This might help your case but because it's more resource demanding than normal monitoring it might not be a good option for very large folders (with subfolders).

-steinar
Today 700 .mxf files 7TB. No subfolders.

Re: how to start a workflow without looking at existing files

Posted: Wed Jan 02, 2019 5:53 pm
by megam
admin wrote: Mon Dec 31, 2018 11:49 pm Manual submitting of files can be done in the FFAStrans Workflow Manager. Just right-click a workflow and select "Submit file(s)". There's also a new web-interface available these days for managing jobs and submitting files: viewtopic.php?f=5&t=789

How big are the folders being monitored? Just asking because the next version will have the option to continously check for changig file size. This might help your case but because it's more resource demanding than normal monitoring it might not be a good option for very large folders (with subfolders).

-steinar
Is it possible to check the presence of a file in the Destination Folder before encoding this file.

Re: how to start a workflow without looking at existing files

Posted: Wed Jan 02, 2019 6:48 pm
by admin
Yes, you can insert a "Conditional" node before encoding that checks if the file exists:
2019-01-02 (1).png
2019-01-02 (1).png (18.8 KiB) Viewed 10471 times
Remember to replace "\\full\path\to\destination.file" with your actual file ;-)

-steinar

Re: how to start a workflow without looking at existing files

Posted: Wed Jan 02, 2019 8:50 pm
by megam
admin wrote: Wed Jan 02, 2019 6:48 pm Yes, you can insert a "Conditional" node before encoding that checks if the file exists:

Remember to replace "\\full\path\to\destination.file" with your actual file ;-)

-steinar
Good! Everything works for me like this $exists("C:\Users\Admin\Desktop\testOUT\%s_original_name%.mp4")

Re: how to start a workflow without looking at existing files

Posted: Fri Jan 04, 2019 12:57 pm
by megam
admin wrote: Wed Jan 02, 2019 6:48 pm
-steinar
I now have another task) for example, I had files in the SOURCE folder, then I delete the unnecessary ones, but I want their proxy copy to be deleted from the Destination folder.
How would i do this?

Compare Folders

Posted: Sun Feb 03, 2019 8:31 pm
by emcodem
You can fulfill these kind of requirements now using the webinterface scheduler.
viewtopic.php?f=5&t=789

1) set up a scheduled job running every 5 minutes or whatever frequency you like
2) hit the "Edit Condition" button and add this script, it will start one ffastrans job for each file that exists in the leftFolder but not in the right one. Take care, it will just send the found filename without extension to your ffastrans workflow, you need to re-assemble it there.

Don't forget to set leftFolder and rightFolder variable below to your folders. (with double backslashes as you see)

Code: Select all

var path = require("path");
var fs = require('fs');

var leftFolder = "C:\\temp\\IN"
var rightFolder = "C:\\temp\\OUT"


fs.readdir(leftFolder, function(err, filesLeft) {
  	//remove extension
    for (il in filesLeft){
      	var extension = path.extname(filesLeft[il]);
    	filesLeft[il] = path.basename(filesLeft[il],extension); 
    }
  
	fs.readdir(rightFolder, function(err, filesRight) {
      	for (il in filesRight){
          	var extension = path.extname(filesRight[il]);
    		filesRight[il] = path.basename(filesRight[il],extension); 
    	}
      	var diff = [];
		for (il in filesLeft){
        	if (!filesRight.includes(filesLeft[il])){
              	console.log(filesLeft[il])
            	process.send([filesLeft[il]])
            }
        }
	
	})
})