Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- if [ -f /var/tmp/.crontab.bak ]
- then
- old="$(md5sum /var/tmp/.crontab.bak | cut -d ' ' -f 1)"
- current="$(md5sum /etc/crontab | cut -d ' ' -f 1)"
- if [ "$old" = "$current" ]
- then
- exit 0
- else
- echo "/etc/crontab has been modified." | mail root
- cat /etc/crontab > /var/tmp/.crontab.bak
- fi
- else
- echo "No old file. Creating a new one."
- cat /etc/crontab > /var/tmp/.crontab.bak
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement