Shape what moves
MFT 3 · 4:06
The supplier's folder also has a price list, and a filter pattern keeps it out of the archive so that only invoice PDFs move. The operation field decides whether the originals stay on the supplier's server.
This part of the video couldn't be loaded.
What it covers
- The
filtersfield, with the pattern*.pdffor the invoices - How each pattern becomes an rclone include rule, followed by one exclude rule
- Applying the change as version 0.1.1, which the deployment picks up
- A new run that copies only the PDF, in the logs and in the Transfers section
- The
operationfield and the difference between copy, move and sync retries,retriesSleepandflags, the fields the scaffold shows as comments
Commands in this video
Terminal
$ weikio apply -f ./finance
$ weikio invoke finance/supplier-invoices --endpoint direct:mft-run
$ weikio logs finance/supplier-invoices --env devtestTranscript
- 0:02The transfer from the earlier MFT videos has moved its first file.
- 0:07This video decides which files the next run moves.
- 0:14The earlier MFT videos set up this transfer.
- 0:17Work happens in the finance folder on your machine.
- 0:20The installation keeps the versions and secrets.
- 0:23Agent dev in devtest runs the transfer as a Java process.
- 0:28The first run moved an invoice, but the supplier's folder holds a price list.
- 0:37The change is one line in this document,
- 0:40written over the commented example under the operation.
- 0:43The field is filters, a list of name patterns:
- 0:48a plain pattern lets through only matching files, and this transfer takes *.pdf.
- 0:54The file-copy engine under the transfer, rclone, gets one include rule per pattern,
- 1:00then a final exclude, so only matching files move.
- 1:07You run weikio apply on the finance folder, devtest taken from your context.
- 1:13The two end documents did not change,
- 1:15and the transfer got version zero point one point one.
- 1:20Nothing more prints, because the deployment already runs what the apply built.
- 1:24The deployment follows latest, so the agent restarts the transfer on the new version,
- 1:30as for every integration.
- 1:36Run it again through its run-now entry, weikio invoke on supplier-invoices.
- 1:42The answer lands before the run starts: the queue waits for a run in progress.
- 1:47The queued run starts.
- 1:49The filter keeps the price list in the supplier's folder.
- 1:55The logs for supplier-invoices in devtest print every line rclone wrote during the run,
- 2:01as it wrote it.
- 2:03The line names the second invoice, copied into the archive,
- 2:07and none exists for the price list.
- 2:09The bucket now holds the second invoice beside the first run's file.
- 2:13The same records stand in the admin UI's Transfers section.
- 2:17The section keeps one row per moved file, newest first,
- 2:22each with its time, file, action and size.
- 2:26The newest row shows the invoice copied, and the price list has no row.
- 2:33The other field that shapes the run is operation.
- 2:36Its value is a subcommand of the rclone inside the agent's image,
- 2:41checked at apply against the list rclone publishes.
- 2:44copy sends the files across and lets the originals stand where they are.
- 2:48move has copy finish first, then takes the files away from the supplier's folder.
- 2:54sync brings the destination to the source's state,
- 2:57deleting whatever the source no longer holds.
- 3:01The example stays with copy.
- 3:07The scaffold writes the other shaping fields as commented lines,
- 3:11for you to take up or leave: retries, retriesSleep and flags.
- 3:17retries sets how many tries rclone gets inside a single run.
- 3:21retriesSleep sets the wait between tries, and left out,
- 3:26rclone works three tries with no wait.
- 3:29flags carries anything else rclone takes, written the way rclone wants it,
- 3:34and the flags are rendered before the filter rules.
- 3:41The filters line now decides which files move, so the rest stay put.
- 3:46The new version runs on agent dev as a Java process.
- 3:50The archive holds the two invoices, but the price list never moved.
- 3:55And the operation stays copy.
Next in this track
MFT 4 · 3:28 What happened: the files behind a run Watched