Archive workflow

Questions and answers on how to get the most out of FFAStrans
ring4life70
Posts: 53
Joined: Thu Apr 15, 2021 6:22 am

Re: Archive workflow

Post by ring4life70 »

Thanks Emcodem,

now the workflow with robocopy command works perfectly, however in the status of the webui the workflow return me an error on the last block (the check result), even if the copy was successful.

1st evaluation of "%s_files_copied% > 0" is " > 0"
emcodem
Posts: 1749
Joined: Wed Sep 19, 2018 8:11 am

Re: Archive workflow

Post by emcodem »

So you see / can you post something like this from the job log?

Code: Select all

               Total    Copied   Skipped  Mismatch    FAILED    Extras
    Dirs :         2         0         2         0         0         0
   Files :        15         0        15         0         0         0
   Bytes :  229.31 m         0  229.31 m         0         0         0
   Times :   0:00:00   0:00:00                       0:00:00   0:00:00
emcodem, wrapping since 2009 you got the rhyme?
ring4life70
Posts: 53
Joined: Thu Apr 15, 2021 6:22 am

Re: Archive workflow

Post by ring4life70 »

Hi emcodem here below the screenshot
Screenshot 2023-09-08 at 9.34.42 AM.png
Screenshot 2023-09-08 at 9.34.42 AM.png (18.96 KiB) Viewed 2565 times
emcodem
Posts: 1749
Joined: Wed Sep 19, 2018 8:11 am

Re: Archive workflow

Post by emcodem »

Just perfect. Sorry i was not aware that robocopy could change language depending on the OS language.

However, it should be easy to solve for you: in the populate processor, you find 2 times:

Code: Select all

$regext("%s_stdout%","Files :.*?\d+.*?(\d+).*?\d+")
Actually it is not 2 times the same but the inner parantesis () are on different position in order to select a different number.

What this does is to look for a line in robocopy output that starts with "Files :" followed by 3 numbers, Totale Copiato and Ignored (Skipped).
As you can see, in my output (english version), the Line starts with "Files :" but in your it starts with "File:"

In the populate Processor, you will need to Change the word "Files :" to "File:" and it should work for you. Notice the space before : - in my Version there was a space but not in yours. I don't know if there is really no space between File and : in your version, you need to check.
emcodem, wrapping since 2009 you got the rhyme?
ring4life70
Posts: 53
Joined: Thu Apr 15, 2021 6:22 am

Re: Archive workflow

Post by ring4life70 »

Thanks Emcodem, everything is fine now, I can confirm you that in my version there is no space between File and :.
So this workflow is fine if I send a folder in the right side of the web interface, but if I want to send a single file (not a folder), it returns an error, is there any way to manage folder or a single file in the same workflow?
emcodem
Posts: 1749
Joined: Wed Sep 19, 2018 8:11 am

Re: Archive workflow

Post by emcodem »

Using a Conditional as start, you could split off into one path for "source is a file" and "source is a folder".
You should be able to use:

Code: Select all

$exists("%s_source%")
and check if it is > 0. If it is 0, then it is most likely a folder (or some bogus string)

In the File path, you just use the deliver processor, not more.
However, i imagine it could be hard to get out the target path you want the file to be sent to. For example, the user submits:
\\NAS\share\project1\day1\test.mxf

in another job he selects:
\\YEY\share\blabla\subfolder\test.mxf

How would you calculate what subfolder the file needs to be placed in?
It is easy whith folders because we just place the last selected folder recursively in the archive root but with files we got some more variables to think about.
emcodem, wrapping since 2009 you got the rhyme?
emcodem
Posts: 1749
Joined: Wed Sep 19, 2018 8:11 am

Re: Archive workflow

Post by emcodem »

By the way, of course we can use webui to present a "dropdown" select field so the user can choose a predefined target location if you have special locations for single files but i have more the feeling that you need to construct some relative path for single files.
emcodem, wrapping since 2009 you got the rhyme?
ring4life70
Posts: 53
Joined: Thu Apr 15, 2021 6:22 am

Re: Archive workflow

Post by ring4life70 »

thanks again Emcodem,
using a Conditional node as start node as you suggested I was able to create two separate workflow branches, one for files and one for folders, and the workflow works exactly as I expected.
Concerning your question : How would you calculate what subfolder the file needs to be placed in?
Fortunately, I don't need it because in our archive we replicate exactly the folder structure of the online path, and I only need to insert in the archive NAS path, the variable %s_original_folder %.
emcodem
Posts: 1749
Joined: Wed Sep 19, 2018 8:11 am

Re: Archive workflow

Post by emcodem »

Congrats!

Looking forward to the day when you ask for "how can i now verify the checksums of the archived vs original files" :D
emcodem, wrapping since 2009 you got the rhyme?
ring4life70
Posts: 53
Joined: Thu Apr 15, 2021 6:22 am

Re: Archive workflow

Post by ring4life70 »

it would be great to create this part of the workflow as well :-)
Post Reply