Update atime when copying FreeSurfer
`shutil.copytree` uses `shutil.copy2`, which uses `shutil.copystat`. When we copy FreeSurfer `fsaverage*` directories, we are creating outputs that look as if they have not been accessed (atime) or modified (mtime) since whatever those are in the bundled FreeSurfer subjects. These may be what they are in the FreeSurfer distribution bundle.

The upshot is that on filesystems that do age-based sweeping (e.g. `/scratch` directories on many HPC clusters), we are basically setting users up to have critical files removed from under them.

This should hit fMRIPrep 20.2.x, 21.0.x and 22.0.x.
diff --git a/niworkflows/interfaces/bids.py b/niworkflows/interfaces/bids.py
index b37318e8..ff31ae6d 100644
--- a/niworkflows/interfaces/bids.py
+++ b/niworkflows/interfaces/bids.py
@@ -4,7 +4,7 @@
 from collections import defaultdict
 from json import dumps, loads
 from pathlib import Path
-from shutil import copytree, rmtree
+import shutil
 from pkg_resources import resource_filename as _pkgres
 import re
 
@@ -869,10 +869,15 @@ class BIDSFreeSurferDir(SimpleInterface):
 
             # Finesse is overrated. Either leave it alone or completely clobber it.
             if dest.exists() and self.inputs.overwrite_fsaverage:
-                rmtree(dest)
+                shutil.rmtree(dest)
             if not dest.exists():
                 try:
-                    copytree(source, dest)
+                    # Use copy instead of copy2; copy calls copymode while copy2 calls
+                    # copystat, which will preserve atime/mtime.
+                    # atime should *not* be copied to avoid triggering processes that
+                    # sweep un-accessed files.
+                    # If we want to preserve mtime, that will require a new copy function.
+                    shutil.copytree(source, dest, copy_function=shutil.copy)
                 except FileExistsError:
                     LOGGER.warning(
                         "%s exists; if multiple jobs are running in parallel"
['niworkflows/interfaces/bids.py']