This repository has been archived by the owner on Jan 19, 2022. It is now read-only.
forked from thornomad/dt-s3-backup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
90 lines (65 loc) · 2.68 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
ABOUT THIS SCRIPT
=================
This bash script was designed to automate and simplify the remote backup
process of duplicity on Amazon S3. After your script is configured, you can
easily backup, restore, verify and clean (either via cron or manually) your
data without having to remember lots of different command options and
passphrases.
Most importantly, you can easily backup the script and your gpg key in a
convenient passphrase-encrypted file. This comes in in handy if/when your
machine ever does go belly up.
Optionally, you can set up an email address where the log file will be sent.
Useful when the script is used via cron.
More information about this script avaiable at:
http://damontimm.com/code/dt-s3-backup
Latest version of the code is available at:
http://github.com/thornomad/dt-s3-backup
BEFORE YOU START
================
This script requires user configuration. Instructions are in
the file itself and should be self-explanatory. Be sure to replace all the
*foobar* values with your real ones. Almost every value needs to be
configured in someway.
You can use multiple copies of the script with different settings for different
backup scenarios. It is designed to run as a cron job and will log information
to a text file (including remote file sizes, if you have s3cmd installed). Be
sure to make the script executable (chmod +x) before you hit the gas.
REQUIREMENTS
============
* duplicity
* gpg
* Amazon S3
* s3cmd (optional)
* mailx (optional)
COMMON USAGE EXAMPLES
=====================
* View help:
$ dt-s3-backup.sh
* Run an incremental backup:
$ dt-s3-backup.sh --backup
* Force a one-off full backup:
$ dt-s3-backup.sh --full
* Restore your entire backup:
$ dt-s3-backup.sh --restore
You will be prompted for a restore directory
$ dt-s3-backup.sh --restore /home/user/restore-folder
You can also provide a restore folder on the command line.
* Restore a specific file in the backup:
$ dt-s3-backup.sh --restore-file
You will be prompted for a file to restore to the current directory
$ dt-s3-backup.sh --restore-file img/mom.jpg
Restores the file img/mom.jpg to the current directory
$ dt-s3-backup.sh --restore-file img/mom.jpg /home/user/i-love-mom.jpg
Restores the file img/mom.jpg to /home/user/i-love-mom.jpg
* List files in the remote archive
$ dt-s3-backup.sh --list-current-files
* Verify the backup
$ dt-s3-backup.sh --verify
* Backup the script and gpg key (for safekeeping)
$ dt-s3-backup.sh --backup-script
NEXT VERSION WISH LIST
======================
* --restore-dir option
* restore files from a specific time period
* support multiple MTAs for the email alert feature
Thanks to Mario Santagiuliana for his help.