Last active
August 29, 2015 14:10
-
-
Save jeffgeiger/f3c0d3fb91d5d643cce6 to your computer and use it in GitHub Desktop.
Cleanup script for files and logs in ROCK
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DATEDIR=$(date +%Y-%m-%d_%H:%M:00) | |
BRO_FILES_DIR="/capes/bro/extract" | |
BRO_FILES_ARCHIVE="/capes/bro/extract/${DATEDIR}" | |
PCAP_FILES_DIR="/pcap/" | |
PCAP_FILES_ARCHIVE="/pcap/${DATEDIR}" | |
mkdir -p $BRO_FILES_ARCHIVE | |
mkdir -p $PCAP_FILES_ARCHIVE | |
find $BRO_FILES_DIR -maxdepth 1 -mindepth 1 -type f -mmin -61 -a -mmin +1 -exec mv '{}' $BRO_FILES_ARCHIVE/ \; | |
find $PCAP_FILES_DIR -maxdepth 1 -mindepth 1 -type f -mmin -65 -a -mmin +5 -exec mv '{}' $PCAP_FILES_ARCHIVE/ \; | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment