All pastes #825180 Raw Edit

Something

public shellscript v1 · immutable
#825180 ·published 2007-12-20 11:44 UTC
rendered paste body
#!/bin/bash#pcboy.pebkac@gmail.comFOLDER=$1usage(){        echo "./preserveperms.sh FOLDER > ./restoreperms.sh";        exit}if [ ${#FOLDER} -eq 0 ];then        usagefiecho "#Starting backup." 1>&2for i in `find $FOLDER`;do        echo -n "chmod ";        echo -n "`stat -c %a $i` $i"        echo -n "; chown "        echo -n "`stat -c %U:%G $i` "        echo $idoneecho "#Finished. Now start restoreperms.sh ;)" 1>&2if [ -f ./restoreperms.sh ];then        chmod +x ./restoreperms.shfi