From c536be51358b8a2651026329c5842b35e9747c49 Mon Sep 17 00:00:00 2001
From: Silvio Rhatto <rhatto@riseup.net>
Date: Wed, 12 Jul 2017 16:20:54 -0300
Subject: [PATCH] Updates backup procedure

---
 research/smartphone.mdwn | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/research/smartphone.mdwn b/research/smartphone.mdwn
index 8a22087..4b56dae 100644
--- a/research/smartphone.mdwn
+++ b/research/smartphone.mdwn
@@ -126,14 +126,19 @@ Backups
 
 Usaremos o [adb-sync](https://github.com/google/adb-sync) e o [adb-export](https://github.com/snatik/adb-export):
 
+    # Pasta de trabalho
+    cd ~/load
+
     # Parâmetros
     date="`date +%Y%m%d`"
     base="/storage/emulated/0"
+    previous="data-do-backup-anterior"
+    storage="/var/backups/remote/celular.`facter domain`/"
 
-    mkdir $date && cd $date
+    mkdir -p $date && cd $date
 
     # Se você tiver um backup antigo e quiser aproveitá-lo com hardlinks:
-    cp -alf /path/to/previous/backup/files files
+    sudo cp -alf $storage/$previous/files files
 
     # Garante a existência da pasta de arquivos
     mkdir -p files
@@ -162,6 +167,9 @@ Usaremos o [adb-sync](https://github.com/google/adb-sync) e o [adb-export](https
       adb-sync --delete --reverse $base/$file files/
     done
 
+    # Move backup to storage
+    cd .. && mv $date $storage/
+
 Restauro
 --------
 
-- 
GitLab