Transforming server with existing data into a GlusterFS node

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Also I wrote a 'set-attrs' script for setting glusterfs attributes on
> existing data, essentially "converting" it to gluster format. Included
> below... It will ignore anything that already has glusterfs attributes, and
> will set them on anything that doesn't.
>
> #!/bin/bash
>
> DIR=$1
>
> if [ -z $DIR ]
>  then
>   echo
>   echo "Error - no path was given."
>   echo
>   echo  "USAGE:  set-attrs /path/to/check"
>   echo
>   echo  "Run set-attrs to check all files and directories in the"
>   echo  "given path for glusterfs attributes. Any files without"
>   echo  "a glusterfs version will be given a version attr of 2"
>   echo  "and a createtime attr equal to the files last modified time."
>   echo
>   echo  "Output information is logged to syslog (usually /var/log/messages)"
>   echo
>   exit 0
>  fi
>
> set_attrs()  {
>
> get_ver="getfattr --absolute-names -n trusted.glusterfs.version"
> set_ver="setfattr -n trusted.glusterfs.version"
> set_ct="setfattr -n trusted.glusterfs.createtime"
>
> if test "`$get_ver $i 2>/dev/null | fgrep -c trusted.glusterfs.version=`" =
> "0"
>  then
>    mods=$((mods+1))
>    # comment out next line to turn off logging
>    initlog -n set-attrs -s "Setting attrs on $i"
>    CT=`stat -c %Y $i`
>    $set_ct -v $CT $i
>    $set_ver -v 2 $i
>  fi
> }
>
> mods=0
> checks=0
>
> initlog -n set-attrs -s "Starting a set-attrs run on path: $DIR"
>
> for i in `find $DIR -print`
>  do
>    set_attrs $i
>    checks=$((checks+1))
>  done
>
> initlog -n set-attrs -s "Completed. $checks checks and $mods mods in this
> run"
>
> exit 0


This script is not needed in the latest AFR. In the latest AFR you do
not need any such script to get things started from an existing
backend.

Avati



[Index of Archives]     [Gluster Development]     [Linux Filesytems Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux