Backing up folders

To backup individuals files I have a program that uses the following code. What should the code be to backup entire folders?

If checkBox1.Value = True Then
'Backup of file.txt
f1 = getFolderItem("/home/backup/file.txt")
If f1.Exists Then
f1.Delete
Else
End If
f1 = getFolderItem("/home/Documents/file.txt")
f2 = getFolderItem("/home/backup/file.txt")
t")
f1.CopyFileTo f2

Else
End If

Recursively loop over folder content.
Or use system copy functions, e.g. Via plugin, shell or declares.

In MBS Plugins:

MacFileOperationMBS class

http://www.monkeybreadsoftware.net/class-macfileoperationmbs.shtml

WindowsFileCopyMBS Class

http://www.monkeybreadsoftware.net/class-windowsfilecopymbs.shtml

in the xojo documentation about folderitem …
https://documentation.xojo.com/index.php/FolderItem.CopyFileTo
there is a nice example …