Restore
Restore
Restore file to captured state
Every captured change carries its SHA-256-addressed content in BLOB_STORE. Restoring writes that content back to the original path — current file gets backed up to <path>.drift_restore_backup_<epoch> before overwrite.
What will change
Preview -- nothing has been written yet.
| Target file | /var/www/vhosts/3dshawn.com/site1/TEMPLATES/file_changes.html |
| Site | DriftSense self-monitor on local |
| Kind | local |
| Captured at | 2026-07-10 23:21:58 |
| Captured SHA | 62734ebeac8d532a931baf5c004ba3a330d296952d713d38f0605bdec552e099 |
Current state on disk
Live check just now. If SHAs match, the restore is a no-op.
| File present | yes |
| Size | 4423 bytes |
| Current SHA | 5e80aec5f8bb |
| Same as captured? | no -- restore will change it |
What restore will change — live diff
Left column shows current on-disk content; right shows what restore will write. +0 additions, -10 deletions, 54 unchanged context lines.
| 1 | 1 | <div class="page-head"> |
| 2 | 2 | <span class="page-eyebrow"><span class="dot"></span> Monitor</span> |
| 3 | 3 | <h1 class="page-title">File changes</h1> |
| 4 | 4 | <p class="page-subtitle">Every file change captured on every watched path. Click a row to view the full diff and restore point.</p> |
| 5 | </div> | |
| 6 | ||
| 7 | <div class="ds-guide"> | |
| 8 | <div class="dsg-icon">i</div> | |
| 9 | <div> | |
| 10 | <span class="dsg-title">Reading the list:</span> | |
| 11 | Each row is one captured change. Click the <strong>filename</strong> or <strong>blob SHA</strong> to open the diff viewer, or the <strong>Restore</strong><span class="ds-help" data-help-title="What Restore does" data-help-body="Writes this captured version's content back to its original path. Current on-disk content is backed up to <code><path>.drift_restore_backup_<epoch></code> before the overwrite. Post-write SHA is verified. Every attempt is logged to <code>RESTORE_LOG</code> whether it succeeded or failed."></span> chip to write it back to disk. The <strong>30-day rhythm</strong><span class="ds-help" data-help-title="Sparkline" data-help-body="A tiny bar chart of how often this file changed over the last 30 days. Files with a busy sparkline are likely <em>live-config</em> files — consider pinning them via <a href='/pin_hotspots.cgi'>Pin hotspots</a>."></span> sparkline shows the file's activity pattern. The <strong>ts</strong> pill means "timestamp only" (mtime touched but bytes identical) — usually noise. | |
| 12 | </div> | |
| 13 | 5 | </div> |
| 14 | 6 | |
| 15 | 7 | $picker_html |
| 16 | 8 | |
| 17 | 9 | <form method="get" action="/file_changes.cgi" style="display:flex;gap:8px;align-items:center;margin-bottom:16px"> |
| 18 | 10 | <input type="hidden" name="days" value="7"> |
| 19 | 11 | <span class="rb-label" style="font-size:11px;letter-spacing:1.4px;text-transform:uppercase;color:var(--text-muted);font-weight:700">Path filter</span> |
| 20 | 12 | <input type="text" name="q" value="$q" placeholder="e.g. /etc/nginx or file.conf" style="flex:1;background:var(--bg-2);color:var(--text);border:1px solid var(--border);border-radius:8px;padding:6px 12px;font-size:12.5px;font-family:inherit"> |
| 21 | 13 | <button type="submit" class="tr-chip is-active" style="border:none">Apply</button> |
| 22 | 14 | [if:$q]<a class="tr-chip" href="/file_changes.cgi">Clear</a>[/if] |
| 23 | 15 | </form> |
| 24 | 16 | |
| 25 | 17 | <div class="module glow-teal"> |
| 26 | 18 | <div class="module-head"><div class="left"> |
| 27 | 19 | <div class="module-icon"><svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/></svg></div> |
| 28 | 20 | <div class="module-title">Changes captured</div> |
| 29 | 21 | <span class="module-subtitle">Content dedup via SHA-256 in BLOB_STORE. Timestamp-only changes marked so you can filter noise. $total match this window.</span> |
| 30 | 22 | </div></div> |
| 31 | 23 | <div class="module-body tight"> |
| 32 | 24 | [if:$has_rows] |
| 33 | 25 | <table class="tbl"> |
| 34 | 26 | <thead><tr> |
| 35 | 27 | <th style="width:100px">Status</th> |
| 36 | 28 | <th>File</th> |
| 37 | 29 | <th style="width:110px">30-day rhythm</th> |
| 38 | 30 | <th style="width:110px">Server</th> |
| 39 | 31 | <th style="width:90px">Blob</th> |
| 40 | 32 | <th style="width:180px">When</th> |
| 41 | <th style="width:80px">Restore</th> | |
| 42 | 33 | </tr></thead> |
| 43 | 34 | <tbody> |
| 44 | 35 | [loop:@rows] |
| 45 | 36 | <tr> |
| 46 | 37 | <td><span class="pill $status_pill">$status</span>[if:$is_ts_only] <span class="pill pill-mute" style="font-size:9px">ts</span>[/if]</td> |
| 47 | 38 | <td class="mono" style="font-size:12px"><a href="$diff_url" style="color:var(--accent-hi);text-decoration:none">$file_name_h</a></td> |
| 48 | 39 | <td>$sparkline_svg</td> |
| 49 | 40 | <td class="dim">$server_name</td> |
| 50 | 41 | <td class="mono dim"><a href="$diff_url" style="color:var(--accent-hi);text-decoration:none">$blob_short</a></td> |
| 51 | 42 | <td class="mono dim"><span class="ts" data-ts="$ts_epoch" data-fmt="datetime">$date_time</span></td> |
| 52 | <td>[if:$can_restore]<a href="$restore_url" class="tr-chip" style="padding:3px 10px;font-size:11px">Restore</a>[/if]</td> | |
| 53 | 43 | </tr> |
| 54 | 44 | [/loop] |
| 55 | 45 | </tbody> |
| 56 | 46 | </table> |
| 57 | 47 | [/if] |
| 58 | 48 | [if:!$has_rows] |
| 59 | 49 | <div style="padding:36px 14px;text-align:center;color:var(--text-dim);font-size:13.5px"> |
| 60 | 50 | No file changes captured in this window. Try widening the range with the chips above, or configure a file monitor in <a href="[url:file_monitors]" style="color:var(--accent-hi)">File monitors</a>. |
| 61 | 51 | </div> |
| 62 | 52 | [/if] |
| 63 | 53 | </div> |
| 64 | 54 | </div> |
Confirm restore
Backs current content to <target>.drift_restore_backup_<epoch>, writes the captured content, verifies SHA post-write.