summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Ball <nullspoon@oper.io>2017-10-24 23:19:27 -0600
committerAaron Ball <nullspoon@oper.io>2017-10-24 23:19:27 -0600
commit177a8a50e95de815a7885283d0d5cf62ef86980d (patch)
tree7dd3236c003c56cd3c5e1e9073e1155831f01fd5
parent79300aebd49b45a63fce6f470cf14e915c3be547 (diff)
downloadandbackup-177a8a50e95de815a7885283d0d5cf62ef86980d.tar.gz
andbackup-177a8a50e95de815a7885283d0d5cf62ef86980d.tar.xz
Fixed bug in tar command
On more robust posix shells, eval of command options stored in variables appears to be automatic. On standard Android system sh though, this is not the case. Added an eval before the tar command and options so the command will execute correctly.
-rwxr-xr-xandbackup.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/andbackup.sh b/andbackup.sh
index e7f2c1d..51b41eb 100755
--- a/andbackup.sh
+++ b/andbackup.sh
@@ -158,21 +158,21 @@ backup_app() {
linfo "Skipping application force stop while booted to recovery mode."
fi
- tar="tar -C ${data} -c "
+ taropts=" -C ${data} -c "
# Delete cache directory if it exists
# This will sometimes free up significant amounts of space
if [[ ! -d "${data}/cache" ]]; then
linfo "Cache doesn't exist for ${app}"
elif [ "$preserve_cache" -eq 0 ]; then
linfo "Excluding cache for ${app}"
- tar="${tar} --exclude=cache"
+ taropts="${taropts} --exclude=cache"
else
linfo "Preserving cache for ${app}"
fi
# Compress the backup
linfo "Compressing userdata for ${app}"
- ${tar} . | gzip -c > "${backups}/${app}/data.tar.gz"
+ eval tar ${taropts} . | gzip -c > "${backups}/${app}/data.tar.gz"
}

Generated by cgit