Welcome! » Log In » Create A New Profile

rsnapshot/utils rsnapshot_invert.sh,NONE

Posted by Anonymous 
rsnapshot/utils rsnapshot_invert.sh,NONE
April 12, 2007 09:46AM
Update of /cvsroot/rsnapshot/rsnapshot/utils
In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv31762/utils

Added Files:
Log Message:
New script rsnapshot_invert.sh creates a parallel directory hierarchy
arranged like backup_point/backup_name instead of backup_name/backup_point
with a combination of directories for backup points and symlinks for the
backup names

--- NEW FILE: rsnapshot_invert.sh ---

# $Id: rsnapshot_invert.sh,v 1.1 2007/04/12 16:51:58 drhyde Exp $

# This script takes one parameter, which should be your rsnapshot config
# file. It will parse that file to find your snapshot_root, backup points,
# and interval/retain values, and will create from those an inverted
# directory structure of backup points containing daily.{0,1,2,3} etc
# symlinks. Run it from a cron job to keep that structure up to date.
# There is minimal^Wno error checking, and the parsing is totally brain-
# dead.

SNAPSHOT_ROOT=`grep ^snapshot_root $1|awk '{print $2}'`
BACKUPS=`grep ^backup $1|awk '{print $3}'`
INTERVALS=`grep -E '^(interval|retain)' $1|awk '{print $2}'`

for i in $BACKUPS; do
mkdir $i
for j in $INTERVALS; do
HOWMANY=`grep -E ^(interval|retain).$j $1|awk '{print $3}'`
while [[ $COUNT != $HOWMANY ]]; do
COUNT=$(($COUNT + 1))

Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
rsnapshot-discuss mailing list
rsnapshot-discuss < at > lists.sourceforge.net
Sorry, only registered users may post in this forum.

Click here to login