Forum Discussion
How to copy backups to multiple drives? (the "3" in 3-2-1) =
Robocopy does not inherently perform a checksum-based verification like some other tools, which means it doesn’t guarantee that the copied files are identical to the source. It only ensures that the size and timestamp of the copied files match. If verification is critical use third-party tools for checksum verification, e.g.: powershell script, xxhash or md5deep to create hash values and compare them.
Is verification necessary at all? This depends on the importance and sensitivity of the data..., windows time for your copy (enought time to complete the entire process).
Robocopy is great for this because it supports filtering by date. You don’t need complex PowerShell scripts unless you need very specific logic.
Robocopy Command:
robocopy "SourceFolder" "DestinationFolder" *.dcm /MAXAGE:YYYYMMDD /E /COPY:DAT
- Replace SourceFolder and DestinationFolder with the actual paths.
- Use *.dcm (or your specific file extension for MR images).
- /MAXAGE:YYYYMMDD: Only copies files modified on or after a specific date.
- /E: Includes subdirectories.
- /COPY:DAT: Copies data, attributes, and timestamps.
If you want to copy files modified on or after a certain date, use /MINAGE instead.
This copies files modified within the last 30 days. Adjust -AddDays(-30) or replace with a specific date.
# Define source and destination directories
$source = "C:\SourceFolder"
$destination = "D:\DestinationFolder"
# Define the date filter (only copy files modified on or after this date)
$dateFilter = (Get-Date "2024-01-01").ToString("yyyyMMdd") # Replace with your desired date
# Construct the robocopy command with filtering
$robocopyCommand = @"
robocopy "$source" "$destination" *.dcm /MINAGE:$dateFilter /E /COPY:DAT /R:3 /W:5
"@
# Execute the robocopy command
Invoke-Expression $robocopyCommand
- Use robocopy for quick, reliable copying with date-based filtering. Add verification only if necessary.
- If you require robust file verification or more advanced logic, consider FreeFileSync or PowerShell.
Bye Gastone