Added info how to copy files without changing the timestamps
This commit is contained in:
1 parent
a26847b332
commit
fffa2fb334
1 file changed
+60
-7
+60
-7
@@ -167,14 +167,14 @@ Beamtime data are processed in *two main phases*:
|
||||
|
||||
### 🔁 Typical Processing Chain
|
||||
`````
|
||||
beamtime raw files
|
||||
↓
importData.m → FileList.mat
|
||||
↓
generateSpectra.m → SpectrumList.mat
|
||||
↓
AnalysisStep4SurfaceConcentration.m → AnalysisStep4SurfaceConcentration.mat
|
||||
↓
GaussFitHClOnIce.m → GaussFitHClOnIce.mat
|
||||
beamtime raw files
|
||||
↓importData.m → FileList.mat
|
||||
↓generateSpectra.m → SpectrumList.mat
|
||||
↓AnalysisStep4SurfaceConcentration.m → AnalysisStep4SurfaceConcentration.mat
|
||||
↓GaussFitHClOnIce.m → GaussFitHClOnIce.mat
|
||||
|
||||
SpectrumList.mat
|
||||
↓
FigureHexylamineN1sLjIce.m → FigureHexylamineN1sLjIce.mat
|
||||
↓FigureHexylamineN1sLjIce.m → FigureHexylamineN1sLjIce.mat
|
||||
``````
|
||||
|
||||
Reuse `.mat` outputs to skip re-running previous steps 🧠💤
|
||||
@@ -258,7 +258,60 @@ save('FileList.mat',"FileList");
|
||||
- Scripts: descriptive names like `generateSpectra.m`, `PlottingForAnand.m`.
|
||||
- Output: typically script‑matching names, saved into `.mat` files.
|
||||
|
||||
***
|
||||
### Data files date and time
|
||||
|
||||
Copying files while preserving their original timestamps (Creation Date and Last Modification Date) is a common challenge because standard "drag-and-drop" operations often treat the copy as a "new" file created at the moment of the transfer.
|
||||
|
||||
To do this safely and reliably, you need to use specific commands or utilities designed for archival integrity.
|
||||
|
||||
#### 🪟 Windows 11: Using Robocopy
|
||||
|
||||
The most robust tool built into Windows is **Robocopy** (Robust File Copy). Unlike the standard copy command, it has specific flags for metadata.
|
||||
|
||||
1. Open **Terminal** or **Command Prompt**.
|
||||
2. Use the following syntax:
|
||||
```cmd
|
||||
robocopy "C:\Source\Folder" "D:\Destination\Folder" /E /DCOPY:DAT /COPY:DAT
|
||||
|
||||
```
|
||||
|
||||
**Breakdown of Flags**
|
||||
|
||||
* **`/E`**: Copies all subdirectories, including empty ones.
|
||||
* **`/DCOPY:DAT`**: This is the crucial part. It tells Windows to copy the **Data, Attributes, and Timestamps** for **directories**.
|
||||
* **`/COPY:DAT`**: Tells Windows to copy the **Data, Attributes, and Timestamps** for **files**.
|
||||
|
||||
---
|
||||
|
||||
#### 🍎 macOS: Using `cp` or `rsync`
|
||||
|
||||
On macOS, the standard "Finder" copy usually preserves the *Modification Date* but often resets the *Creation Date* to the time of the copy. To preserve everything, use the Terminal.
|
||||
|
||||
##### Option A: The `cp` command (Simplest)
|
||||
|
||||
1. Open **Terminal**.
|
||||
2. Run:
|
||||
```bash
|
||||
cp -pPR /Source/Path /Destination/Path
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
* **`-p`**: Preserves modification time, access time, file flags, and permissions.
|
||||
* **`-R`**: Recursive (copies folders and their contents).
|
||||
|
||||
##### Option B: `rsync` (Best for large transfers)
|
||||
|
||||
Rsync is the professional standard for syncing data while maintaining metadata.
|
||||
|
||||
```bash
|
||||
rsync -avz --times /Source/Path/ /Destination/Path/
|
||||
|
||||
```
|
||||
|
||||
* **`-a` (Archive mode)**: This is a "bundle" flag that preserves permissions, symlinks, and—crucially—timestamps.
|
||||
* **`--times`**: Explicitly ensures modification times are transferred.
|
||||
|
||||
## The shared data table
|
||||
|
||||
|
||||
Reference in new issue
Block a user