Skip to content

Instantly share code, notes, and snippets.

@fnzv
Last active May 10, 2018 12:41
Show Gist options
  • Save fnzv/c29b9df8098affc52a2c29ec94a2a4a3 to your computer and use it in GitHub Desktop.
Save fnzv/c29b9df8098affc52a2c29ec94a2a4a3 to your computer and use it in GitHub Desktop.
monitor-system-files.sh
#!/bin/bash
find / -xdev | sort > /root/fs-pre-snapshot.txt
sleep 2m
find / -xdev | sort > /root/fs-post-snapshot.txt
diff -daU 0 /root/fs-pre-snapshot.txt /root/fs-post-snapshot.txt | grep -vE '^(@@|\+\+\+|---)'
@fnzv
Copy link
Author

fnzv commented May 10, 2018

Other ways to "snapshot" permission are:

  • find . -type f | xargs stat --printf="chmod %a %n\n" >> /root/directory_permissions_$(date +%s)
  • getfacl -R / > permissions.acl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment