diff --git a/CHANGELOG b/CHANGELOG index dd1fbe5..dae3537 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,6 @@ Version Four (marionline) * Add --list-current-files to view in the standart-output files stored in my archive + * Modification on --restore: if I provide a path to --restore option I don't want to answare a confermation question too Version Four (0.4) diff --git a/README b/README index 3e70f15..4d77abb 100644 --- a/README +++ b/README @@ -2,9 +2,53 @@ More information about this script avaiable at: http://damontimm.com/code/dt-s3-backup -TO DO: +==TO DO== * 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 * Clean up general formatting of the script and make it pretty * give demo on how to use an "--archive-dir" option -* test --restore-file (specific) option <--- marionline --- seem to work fine for me +* test --restore-file (specific) option <--- marionline --- seem to work fine for me, test with little archive +* Add --restore-dir option + +=== USAGE EXAMPLE === +You must configure the script before using it you can config it with your favorites test editor(read comments in script). +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. +Then make the script executable with "chmod +x". + +==Common usage== + += View help + $ dt-s3-backup.sh + += Run an incremental backup of configured directory + $ dt-s3-backup.sh --backup + += Restore your backup +To restore the backup in the current work directory just run: + $ dt-s3-backup.sh --restore ./ + +You can provide another directory to restore, for example: I want to restore my backup in "my_restore" folder (not created yet or existing): + $ dt-s3-backup.sh --restore my_restore + +If you don't provide a path you will prompt to answare some question to restore your backup + +==Special usage== + += List files beckend up in the remote archive + $ dt-s3-backup.sh --list-current-files + += Restore a specific file +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: + $ dt-s3-backup.sh --restore-file Pictures/mygirlfriend.jpg + +Now mygirlfriend.jpg is under "Pictures" directory. +But if I want to change the name when I restore it? I just need to provide a new name: + $ dt-s3-backup.sh --restore-file Pictures/mygirlfriend.jpg Pictures/myExgirlfriend.jpg + +In my Pictures directory I have myExgirlfriend.jpg. +Attention: if "Pictures" directory doesn't exist you have got an error. You must provide an existing directory. + += Verifies the backup +$ dt-s3-backup.sh --verify +Then you can view the verification opening the log file (that you have previously configure). + diff --git a/dt-s3-backup.sh b/dt-s3-backup.sh index 34322bd..4706a87 100755 --- a/dt-s3-backup.sh +++ b/dt-s3-backup.sh @@ -349,19 +349,18 @@ elif [ "$1" = "--restore" ]; then echo "Please provide a destination path (/home/user/restore-dir):" read -e NEWDESTINATION DEST=$NEWDESTINATION + echo ">> You will restore from ${ROOT} to ${DEST}" + echo "Are you sure you want to do that ('yes' to continue)?" + read ANSWER + if [[ "$ANSWER" != "yes" ]]; then + echo "You said << ${ANSWER} >> so I am exiting now." + echo -e "User aborted restore process ...\n" >> ${LOGFILE} + exit 1 + fi else DEST=$2 fi - echo ">> You will restore from ${ROOT} to ${DEST}" - echo "Are you sure you want to do that ('yes' to continue)?" - read ANSWER - if [[ "$ANSWER" != "yes" ]]; then - echo "You said << ${ANSWER} >> so I am exiting now." - echo -e "User aborted restore process ...\n" >> ${LOGFILE} - exit 1 - fi - echo "Attempting to restore now ..." duplicity_backup