blob: d0d17d42f2c31d800e56a1fdc195bcc626b8c0f5 [file] [log] [blame]
david_williamsb1a981c2007-10-23 19:55:06 +00001
2copyAndRemove ()
3{
4 oldDir=${1}
5 newDir=${2}
6 if [ ! -d ${oldDir} ]
7 then
david_williams29f8bba2007-10-24 01:03:48 +00008 echo "${oldDir} does not exist"
david_williamsb1a981c2007-10-23 19:55:06 +00009 return;
10 fi
david_williams4e08c5c2007-10-23 22:32:49 +000011
david_williamsb1a981c2007-10-23 19:55:06 +000012 echo "oldDir: ${oldDir}"
david_williamsb1a981c2007-10-23 19:55:06 +000013 echo "newDir: ${newDir}"
david_williams4e08c5c2007-10-23 22:32:49 +000014
david_williamsb1a981c2007-10-23 19:55:06 +000015 mkdir -p ${newDir}
david_williams4e08c5c2007-10-23 22:32:49 +000016 rsync --backup --recursive ${oldDir} ${newDir}
david_williamsb1a981c2007-10-23 19:55:06 +000017 if [ "$?" -eq "0" ]
18 then
19 rm -fr ${oldDir}
20 fi
21 return;
22}