Files

Frends.Files.LocalBackup / 4.0.0

Summary

Copies files into a backup directory, optionally one subdirectory per run so successive runs do not overwrite each other, and can prune directories older than a given age.

Typical use — keeping a safety copy of what a Process consumed, with retention handled in the same step

Details

Frends version
5.7 and newer
Agent
Crossplatform
Target framework
net8.0

Input parameters.

Name Type Default Example Description
SourceDirectory String – c:\temp

Source directory.

SourceFile String – Literal/wildcard: test.txt, Sub/*.txt, **/*.csv, invoice(2024).pdf Regex: <regex>test.(txt|xml), <regex>^Sub/.+\.txt$, <regex>^(?!prof).*_test.txt

Source file pattern to match files directly in SourceDirectory. Matching is case-insensitive. For regex mode, prefix the pattern with and the matcher checks the full relative path and filename. For wildcard mode, * and ** work as glob operators and regex special characters are treated literally.

FilePaths Object – #trigger.data.filePaths

The paths to the files to be backuped, mainly meant to be used with the file trigger with the syntax: #trigger.data.filePaths FilePaths will overwrite SourceDirectory and SourceFile parameters.

BackupDirectory String – c:\temp\backups, c:\temp\backups\

Destination directory where backup folder will be created. Backup directory's format if CreateSubdirectories=true: -.

CreateSubdirectories Boolean True true

Create a subdirectory into the given backup directory.

TaskExecutionId String #process.executionid e7e34166-f4fd-45e5-9307-ea5c2cf8e037, foobar123

Enabled when (Create Subdirectories) is true. Value which is used in naming the backup directory. Can be any string but using task's execution id as default to avoid duplicate directory names.

Cleanup Boolean – false

Cleanup older than folders from backup directory. If Create Subdirectories is false, individual files will also get cleaned.

DaysOlder Int32 – 30

Clean up backups older than given value in days. Enabled when is true.

An unhandled error has occurred. Reload 🗙