diff options
author | Aaron Ball <nullspoon@iohq.net> | 2016-10-07 08:35:58 -0600 |
---|---|---|
committer | Aaron Ball <nullspoon@iohq.net> | 2016-10-07 08:35:58 -0600 |
commit | 3b7614f65e01a4f74779f866732dee3e3699dd07 (patch) | |
tree | 26b80528a4d35cd95879e19807e399b7c4f22d16 | |
parent | fd6b3fcf211fa79c5b0f413e57bd7544259d985e (diff) | |
download | andbackup-3b7614f65e01a4f74779f866732dee3e3699dd07.tar.gz andbackup-3b7614f65e01a4f74779f866732dee3e3699dd07.tar.xz |
Added post-restore cleanup and small message fixes
Was extracting data to be restored, but left the extracted version
there, taking much space sometimes. This cleans up the data directory
after the restore has completed.
Also updated a few messages to make them more unified.
-rwxr-xr-x | andbackup.sh | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/andbackup.sh b/andbackup.sh index 01ffedb..d68fc23 100755 --- a/andbackup.sh +++ b/andbackup.sh @@ -36,7 +36,7 @@ function backup_app { return 1 fi - echo "# Backing up ${app}" + echo "Backing up ${app}" # Stop the application if it is running am force-stop ${app} @@ -96,7 +96,7 @@ function restore_app { return 1 fi - echo "# Restoring ${app}" + echo "Restoring ${app}" # Install app if it is not yet installed if [[ ! -f "${backups}/${app}/base.apk" ]]; then @@ -123,6 +123,9 @@ function restore_app { cp -rp ${backups}/${app}/data/* ${data}/ # Fix data permissions chown -R ${owner}:${owner} ${data} + + # Cleanup the extracted data so restores don't take too much space + rm -rf ${backups}/${app}/data } @@ -145,6 +148,7 @@ function restore_apps { done } + function list_backup_apps { local list=${1:-} [[ -z ${list} ]] && echo "A backup list is required." && return 1 |