aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2018-11-25 10:17:44 -0200
committerSilvio Rhatto <rhatto@riseup.net>2018-11-25 10:17:44 -0200
commit0f1fdb1e70fd4cc277a92043b8db0d0afbade663 (patch)
tree1be4897ad35db8a6bcda8e96455af1e3abd153ab
parent382213c210f12ce883381c96906a560672af810e (diff)
downloadscripts-0f1fdb1e70fd4cc277a92043b8db0d0afbade663.tar.gz
scripts-0f1fdb1e70fd4cc277a92043b8db0d0afbade663.tar.bz2
Require phone name at android-backup
-rwxr-xr-xandroid-backup10
1 files changed, 9 insertions, 1 deletions
diff --git a/android-backup b/android-backup
index 359f41a..70c5006 100755
--- a/android-backup
+++ b/android-backup
@@ -4,11 +4,19 @@
#
# Parameters
+basename="`basename $0`"
+name="$1"
date="`date +%Y%m%d`"
base="/storage/emulated/0"
-storage="/var/backups/remote/celular.`facter domain`/"
+storage="/var/backups/remote/$name.`facter domain`/"
previous="`sudo ls -1 $storage | tac | head -n 1`"
+# Check
+if [ -z "$name" ]; then
+ echo "$basename: missing phone name"
+ exit 1
+fi
+
# Work folder
cd ~/load || exit 1
mkdir -p $date && cd $date