Skip to content

Instantly share code, notes, and snippets.

@tomhat
Created February 17, 2020 20:43
Show Gist options
  • Save tomhat/318b63a10b9004295d7ee08f6e7c60e2 to your computer and use it in GitHub Desktop.
Save tomhat/318b63a10b9004295d7ee08f6e7c60e2 to your computer and use it in GitHub Desktop.
Update Aide+logging Shell Script
#!/bin/sh
LOGTIME=`date +'%Y%m%d'`
echo "start:`date +'%Y/%m/%d %H:%M:%S'`" >> /home/hatabo/shell/aide/aide$LOGTIME.log
/usr/sbin/aide --update >> /home/hatabo/shell/aide/aide$LOGTIME.log
echo "copy aide.db.new.gz => /var/lib/aide/aide.db.gz" >> /home/hatabo/shell/aide/aide$LOGTIME.log
/bin/cp /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz
echo "start:`date +'%Y/%m/%d %H:%M:%S'`" >> /home/hatabo/shell/aide/aide$LOGTIME.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment