Differential Backup Logic
As a user, I want to perform a differential backup, So that I can save execution time and disk space by only copying files that have been added or modified compared to the target.
Given a file in the source has the exact same Size and LastWriteTime as the file in the target,
When the differential backup executes,
Then the file is considered identical and is ignored.
Given a file in the source has a different Size OR a more recent LastWriteTime than the target,
When the differential backup executes,
Then the file is copied to a staging location, its integrity is verified against the source, and it overwrites the older version in the target only after verification.
Given a new file in the source that does not exist in the target,
When the differential backup executes,
Then the new file is copied to the target.
Given files in the target that no longer exist in the source,
When the differential backup executes,
Then those obsolete files are deleted from the target.
Given all files to copy and delete have been processed,
When the differential job finalizes,
Then the copied files are moved from the staging location to their final destination in the target.