Diff
1diff --git a/CHANGELOG b/CHANGELOG
2index dd1fbe5aa25d5037665d32537b0ee689d53e26d4..dae3537ebc4b35d52bf4fdac3dbccc6e9884ed43 100644
3--- a/CHANGELOG
4+++ b/CHANGELOG
5@@ -1,5 +1,6 @@
6 Version Four (marionline)
7 * Add --list-current-files to view in the standart-output files stored in my archive
8+ * Modification on --restore: if I provide a path to --restore option I don't want to answare a confermation question too
9
10 Version Four (0.4)
11
12diff --git a/README b/README
13index 3e70f159d4c52ea9952417dcf9a17a43735cbd73..4d77abb6944c8a76d64ffc548f1b6952788a8ff0 100644
14--- a/README
15+++ b/README
16@@ -2,9 +2,53 @@
17
18 More information about this script avaiable at: http://damontimm.com/code/dt-s3-backup
19
20-TO DO:
21+==TO DO==
22
23 * Add a README file to the "--backup-this-script" option because, if you are like me, when it is working for so long I forget what to do when it comes time to restore
24 * Clean up general formatting of the script and make it pretty
25 * give demo on how to use an "--archive-dir" option
26-* test --restore-file (specific) option <--- marionline --- seem to work fine for me
27+* test --restore-file (specific) option <--- marionline --- seem to work fine for me, test with little archive
28+* Add --restore-dir option
29+
30+=== USAGE EXAMPLE ===
31+You must configure the script before using it you can config it with your favorites test editor(read comments in script).
32+You can put the script under bin directory of your user. If you have configured correctly your shell you will call dt-s3-backup.sh whenever you want.
33+Then make the script executable with "chmod +x".
34+
35+==Common usage==
36+
37+= View help
38+ $ dt-s3-backup.sh
39+
40+= Run an incremental backup of configured directory
41+ $ dt-s3-backup.sh --backup
42+
43+= Restore your backup
44+To restore the backup in the current work directory just run:
45+ $ dt-s3-backup.sh --restore ./
46+
47+You can provide another directory to restore, for example: I want to restore my backup in "my_restore" folder (not created yet or existing):
48+ $ dt-s3-backup.sh --restore my_restore
49+
50+If you don't provide a path you will prompt to answare some question to restore your backup
51+
52+==Special usage==
53+
54+= List files beckend up in the remote archive
55+ $ dt-s3-backup.sh --list-current-files
56+
57+= Restore a specific file
58+I have deleted my favourites picture file 'mygirlfriend.jpg' present in my "Pictures" home directory, I backup it with dt-s3-backup and I can restore it with:
59+ $ dt-s3-backup.sh --restore-file Pictures/mygirlfriend.jpg
60+
61+Now mygirlfriend.jpg is under "Pictures" directory.
62+But if I want to change the name when I restore it? I just need to provide a new name:
63+ $ dt-s3-backup.sh --restore-file Pictures/mygirlfriend.jpg Pictures/myExgirlfriend.jpg
64+
65+In my Pictures directory I have myExgirlfriend.jpg.
66+Attention: if "Pictures" directory doesn't exist you have got an error. You must provide an existing directory.
67+
68+= Verifies the backup
69+$ dt-s3-backup.sh --verify
70+Then you can view the verification opening the log file (that you have previously configure).
71+
72diff --git a/dt-s3-backup.sh b/dt-s3-backup.sh
73index 34322bdd7c3cabfb1a4663a111c4b60d54ff4668..4706a8757e90c72c3fd352ee5818baeb27c65506 100755
74--- a/dt-s3-backup.sh
75+++ b/dt-s3-backup.sh
76@@ -349,19 +349,18 @@ elif [ "$1" = "--restore" ]; then
77 echo "Please provide a destination path (/home/user/restore-dir):"
78 read -e NEWDESTINATION
79 DEST=$NEWDESTINATION
80+ echo ">> You will restore from ${ROOT} to ${DEST}"
81+ echo "Are you sure you want to do that ('yes' to continue)?"
82+ read ANSWER
83+ if [[ "$ANSWER" != "yes" ]]; then
84+ echo "You said << ${ANSWER} >> so I am exiting now."
85+ echo -e "User aborted restore process ...\n" >> ${LOGFILE}
86+ exit 1
87+ fi
88 else
89 DEST=$2
90 fi
91
92- echo ">> You will restore from ${ROOT} to ${DEST}"
93- echo "Are you sure you want to do that ('yes' to continue)?"
94- read ANSWER
95- if [[ "$ANSWER" != "yes" ]]; then
96- echo "You said << ${ANSWER} >> so I am exiting now."
97- echo -e "User aborted restore process ...\n" >> ${LOGFILE}
98- exit 1
99- fi
100-
101 echo "Attempting to restore now ..."
102 duplicity_backup
103