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:
rsnapshot_invert.sh
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 ---
#!/bin/bash

# $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}'`

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

-------------------------------------------------------------------------
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
[www.techsay.com]
_______________________________________________
rsnapshot-discuss mailing list
rsnapshot-discuss < at > lists.sourceforge.net
[lists.sourceforge.net]
Sorry, only registered users may post in this forum.

Click here to login


Parse error: syntax error, unexpected 'GoogleAnalyticsObject' (T_STRING), expecting ']' in /tmp/tpl-lightweight_blue-footer-bc9d4c1f6d5e5fdfdcbff526fb7bae92.php-stage2 on line 6