how to start a workflow without looking at existing files

Questions and answers on how to get the most out of FFAStrans
megam
Posts: 12
Joined: Wed Dec 26, 2018 8:56 pm

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

Post 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.
megam
Posts: 12
Joined: Wed Dec 26, 2018 8:56 pm

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

Post 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.
Attachments
Screen
Screen
Screen1.PNG (35.11 KiB) Viewed 9182 times
admin
Site Admin
Posts: 1667
Joined: Sat Feb 08, 2014 10:39 pm

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

Post 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 9179 times
Remember to replace "\\full\path\to\destination.file" with your actual file ;-)

-steinar
megam
Posts: 12
Joined: Wed Dec 26, 2018 8:56 pm

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

Post 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")
megam
Posts: 12
Joined: Wed Dec 26, 2018 8:56 pm

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

Post 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?
emcodem
Posts: 1651
Joined: Wed Sep 19, 2018 8:11 am

Compare Folders

Post 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]])
            }
        }
	
	})
})
emcodem, wrapping since 2009 you got the rhyme?
Post Reply