Something
public shellscript v1 · immutable#!/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