Skip to content

Instantly share code, notes, and snippets.

@ramazanpolat
Created March 26, 2014 08:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ramazanpolat/9779000 to your computer and use it in GitHub Desktop.
Save ramazanpolat/9779000 to your computer and use it in GitHub Desktop.
START_DATE=`date`
SOURCE_DIR=/RMData/lbosdata/00001/
DEST_DIR=/RMData_new/lbosdata/00001/
echo "Source Dir:$SOURCE_DIR"
echo "Destination Dir:$DEST_DIR"
read -p "Press any key to continue, CTRL+C to break ..."
cd $SOURCE_DIR
DIRS=`find ./ -type d | tail -n 100 | sort`
i=1
for xdir in $DIRS
do
echo "Copying $xdir ... "
cd $xdir
time { find . | cpio -pdum $DEST_DIR$xdir/ ;}
echo "process at %$i"
cd ..
#sleep 1
i=`expr $i + 1`
done
echo Migration successful
echo "Started at : $START_DATE"
echo "Ended at: `date`"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment