From 0f1fdb1e70fd4cc277a92043b8db0d0afbade663 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sun, 25 Nov 2018 10:17:44 -0200 Subject: Require phone name at android-backup --- android-backup | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3