Skip to content

Instantly share code, notes, and snippets.

@phra
Created June 2, 2018 21:23
Show Gist options
  • Save phra/95417a1588cc211a45bd8fbab79221d7 to your computer and use it in GitHub Desktop.
Save phra/95417a1588cc211a45bd8fbab79221d7 to your computer and use it in GitHub Desktop.
Detect cronjobs without reading permission
#!/bin/bash
IFS=$'\n'
old_process=$(ps -eo command)
while true; do
new_process=$(ps -eo command)
diff <(echo "$old_process") <(echo "$new_process")
sleep 1
old_process=$new_process
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment