diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2008-07-20 05:09:31 +0000 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2010-09-30 07:08:11 +0000 |
commit | d4b6208d03a2b0521c9770ed931115bc88db1eb6 (patch) | |
tree | e9c2b477d6671c8cf1213a2851c2aeea8b47b95e /Library/move.sh | |
parent | 1ef3da8cf14a6f67b04a4c38b76fd59010d11700 (diff) |
Dealing with disk space issues.
Diffstat (limited to 'Library/move.sh')
-rwxr-xr-x | Library/move.sh | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Library/move.sh b/Library/move.sh index 0b9e09d..3cbe799 100755 --- a/Library/move.sh +++ b/Library/move.sh @@ -2,6 +2,13 @@ shopt -s extglob nullglob +if [[ ${1:0:1} == - ]]; then + v=$1 + shift 1 +else + v= +fi + function df_() { free=$(df -B1 "$1") free=${free% *%*} @@ -20,12 +27,12 @@ function mv_() { chmod --reference="${src}" "${dst}" chown --reference="${src}" "${dst}" - cp -aT "${src}" "${dst}" || { + cp -aT $v "${src}" "${dst}" || { rm -rf "${dst}" exit 1 } - rm -rf "${src}" + rm -rf $v "${src}" else chmod 775 "${dst}" chown root.admin "${dst}" |