Skip to content

Instantly share code, notes, and snippets.

@JustinAzoff
Created July 26, 2013 13:42
Show Gist options
  • Save JustinAzoff/6088943 to your computer and use it in GitHub Desktop.
Save JustinAzoff/6088943 to your computer and use it in GitHub Desktop.
Script to dump and restore rrd files on another machine.
#!/bin/sh -x
# cd /path/to/application/root
# convert_rrd.sh otherhost /new/application/root
HOST=$1
DIR=$2
for f in `find -name '*.rrd'`; do
rrdtool dump $f | ssh $HOST "cat > ~/dump.xml"
ssh $HOST "cd $DIR;rrdtool restore -f ~/dump.xml $f"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment