filegone(8)

๐Ÿฆ‹ filegone(8) ยท System Manager's Manual ๐Ÿฆ‹

โœจ NAME โœจ

okay so filegone is the tool that tells you why a file vanished ๐Ÿ‘€ It traces who deleted or renamed it. It runs on Linux eBPF/bcc, so it's giving low-level detective energy ๐Ÿ•ต๏ธโ€โ™€๏ธ๐Ÿ’…

๐Ÿ”ฎ SYNOPSIS ๐Ÿ”ฎ

filegone [-h] [-p PID]

๐Ÿ’– DESCRIPTION ๐Ÿ’–

this traces why a file went poof ๐Ÿ’จ aka it's gone, deleted, or renamed, and tells you who did it ๐Ÿซฃ

it works by tracing the kernel vfs_unlink(), vfs_rmdir(), and vfs_rename functions โœจ

โš ๏ธ bestie, this one uses BPF, so only the root user can use this tool. no cap, sorry not sorry ๐Ÿ™…โ€โ™€๏ธ

๐ŸŽ€ REQUIREMENTS ๐ŸŽ€

you'll need CONFIG_BPF and bcc ๐Ÿงš

๐Ÿ’… OPTIONS ๐Ÿ’…

  • -h โ€” pulls up the usage message ๐Ÿ“–
  • -p PID โ€” only traces this process ID ๐ŸŽฏ (filtered right in the kernel, so it's super efficient ๐Ÿ’œ)

๐Ÿ“ EXAMPLES ๐Ÿ“

Trace all file gone events:

# filegone

Trace file gone events caused by PID 181:

# filegone -p 181

๐Ÿ“ธ FIELDS ๐Ÿ“ธ

  • TIME โ€” when the event happened โฐ
  • PID โ€” the process ID that renamed or deleted the file ๐Ÿซถ
  • COMM โ€” the process name for that PID ๐Ÿท๏ธ
  • ACTION โ€” what happened to the file: DELETE or RENAME ๐Ÿ’€
  • FILE โ€” the filename ๐Ÿ“„

๐ŸŒธ OVERHEAD ๐ŸŒธ

this traces the kernel VFS file rename and delete functions and prints output for each event. the rate is generally expected to be low (< 1000/s), so the overhead is also expected to be negligible โœจ it comes from bcc ๐Ÿฆ‹

the bcc repo lives here:

https://github.com/iovisor/bcc

also, lowkey important: check the bcc distribution for a companion _examples.txt file ๐Ÿ“š it has example usage, output, and commentary for this tool. iykyk ๐Ÿ™ˆ

๐ŸŒˆ OS ๐ŸŒˆ

Linux ๐Ÿง

๐Ÿงช STABILITY ๐Ÿงช

Unstable - still in development ๐Ÿšง so it might be a little chaotic rn ๐Ÿ˜ญ

๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

Curu Wong ๐Ÿ’œ

๐Ÿ”— SEE ALSO ๐Ÿ”—

filelife(8) ๐Ÿงš


okay that's the whole tea ๐Ÿซถ go forth and catch those vanishing files ๐Ÿ”ฅโœจ love u bestie, bye ๐Ÿ’– (source: USER COMMANDS, dated 2022-11-18 ๐ŸŽ€)