Skip to content

Instantly share code, notes, and snippets.

@mbrownnycnyc
Last active December 17, 2015 06:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbrownnycnyc/5568745 to your computer and use it in GitHub Desktop.
Save mbrownnycnyc/5568745 to your computer and use it in GitHub Desktop.
a quick script that copies gzipped argus data files (produced with `rastream -S 127.0.0.1:561 -B 15s -M time 1h -w /var/opt/argus/%Y-%m-%d/argus_%T -f /usr/local/bin/rastream.sh` for instance [note the use of %Y-%m-%d]) to a working directory. This is to ease the targeting of queries.
#!/bin/bash
#arguswork script to copy and rename argus files to a working directory
#I've commented out the original script, which follows a different organizational structure.
# to limit times, I've opted to use the -t argument with any ra* clients instead of worrying about limiting time simply by argus data files read.
#mkdir -p ~/working/`basename $(pwd)`
#cp * ~/working/`basename $(pwd)`
#cd ~/working/`basename $(pwd)`
#gunzip *
export dateoffiles="$(basename $(pwd))_"
cp * ~/working/
cd ~/working/
for f in $(ls -m1 argus_*) ; do mv "$f" "$dateoffiles$f" ; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment