summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Ball <nullspoon@oper.io>2017-10-26 00:21:59 -0600
committerAaron Ball <nullspoon@oper.io>2017-10-26 00:21:59 -0600
commit60a06067a7683d41653fe83ec5cbf6e74758fd81 (patch)
treef1de63368d995cb3a4baf5d8d9f08af1ab778e00
parent25d920e381659bd43574b49882e4cc64a5178db8 (diff)
parenta1cc9dc039be9dcf984503bf52c219982490632a (diff)
downloadandbackup-60a06067a7683d41653fe83ec5cbf6e74758fd81.tar.gz
andbackup-60a06067a7683d41653fe83ec5cbf6e74758fd81.tar.xz
Merge branch 'restore-in-mem'
-rwxr-xr-xandbackup.sh17
1 files changed, 5 insertions, 12 deletions
diff --git a/andbackup.sh b/andbackup.sh
index 86fdefa..e8bbae8 100755
--- a/andbackup.sh
+++ b/andbackup.sh
@@ -227,24 +227,17 @@ restore_app() {
# Get pertinent metadata
local owner=$(dumpsys package ${app} | grep userId | cut -d'=' -f2 | head -n1)
- local code=$(dumpsys package ${app} | grep codePath | cut -d'=' -f2 | head -n1)
- local data=$(dumpsys package ${app} | grep dataDir | cut -d'=' -f2 | head -n1)
+ local data="/data/data/${app}"
- # Decompress backup
+ # Decompress data backup
linfo "Decompressing user data for ${app}."
- cd ${backups}/${app}/
- gzip -d -c data.tar.gz | tar -x
+ gzip -d -c ${backups}/${app}/data.tar.gz | tar -x -C "${data}"
- # Copy the user data in
- cp -rp ${backups}/${app}/data/* ${data}/
# Fix data permissions
- chown -R ${owner}:${owner} ${data}
+ chown -R ${owner}:${owner} "${data}"
# Fix selinux labels
linfo "Restoring SELinux contexs for ${app}"
- restorecon -R ${data} 2>/dev/null
-
- # Cleanup the extracted data so restores don't take too much space
- rm -rf ${backups}/${app}/data
+ restorecon -R "${data}" 2>/dev/null
}

Generated by cgit