Fixing oddball timestamps on files and folders

Sometimes you may run into a problem with backing up files that have their "created" or "last-modified" times set to either very distant past or very distant future.

The problem will manifest itself in either "SetFileTime() failed with 87" errors being reported in the log or these file getting recopied on every backup run.

The cause

The cause of the problem is that these timestamps fall outside of the range supported by the file system of the backup device and they simply cannot be recorded.

To compound the problem, in many cases an attempt to set these invalid times will seemingly succeed even though it will silently fail.

Here's a sample of supported ranges for common file systems:

FAT 1980-01-01 to 2099-12-31
exFAT 1980-01-01 to 2107-12-31
NTFS 1601-01-01 to 60056-05-28 (this is not a typo)
ext3 1901-12-14 to 2038-01-18

So, if you are trying to copy an NTFS file last modified in 1812-09-07 onto a NAS box that runs ext3, the file may end up with its last-modified time set to "now" rather than the date of that glorious battle.

The solution

The solution is to reset these timestamps to more reasonable values.

Since this requires changing _source_ files, this is not something that is a part of Bvckup 2 itself as it never modifies anything at the source.

Option A

There's now a little companion tool called Timestamp Clamper that does just that - it forces timestamps into specified range.