-
Notifications
You must be signed in to change notification settings - Fork 11
/
README
104 lines (73 loc) · 3.28 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
91
92
93
94
95
96
97
98
99
100
101
102
103
yhager's rsync based backup scripts
yet another backup script suite, that does exactly what I want.
* automatic
* offsite(online)
* bandwidth and space efficient
* incremental
Some more detailed list of the features:
* use rsync snapshots with hardlinks[1] - a no frills working backup solution:
* allows going back in time for as long as you want
* uses the minimal amount of storage space required
* clear up old backups easily by deleting a directory
* can retry the backup if the network failed during the process
* use crontab to control backup initiation
* simple, simple, simple
The script more or less implements the method outlined by rsync.net's
support team[2]
[1] http://www.mikerubel.org/computers/rsync_snapshots/
[2] http://www.rsync.net/resources/howto/rsync_snapshots.html
Installation:
# most of the steps require root privilege
su
# copy this entire directory onto /usr/local/backup
cp -a . /usr/local/backup
cd /usr/local/backup
# edit the file conf.d/backup to match your settings
vi conf.d/backup
# copy the file to /etc/conf.d
mkdir /etc/conf.d
cp conf.d/backup /etc/conf.d/
# edit the rules file to match your setup
vi conf.d/rsync-rules
# copy to /etc/backup
mkdir /etc/backup
cp conf.d/rsync-rules /etc/backup/.
# create a directory for mysql backups
mkdir -p /var/backups/mysql
# Add the crontab to your existing crontab
crontab -l > /tmp/crontab && cat /tmp/crontab crontab | crontab - && rm /tmp/crontab
# or if your crontab is currently empty, simply
crontab crontab
Encryption:
I do not encrypt my backups. I am getting too nervous about losing
the private key (where would I keep it? in a USB storage? in a bank?
printed and kept at a friend's house? - I was never able to solve
that question), so I decided that encryption might give me more
headache than benefit.
Edit: The above paragraph made sense at the time I wrote it; I now
strongly recommend that you incorporate some encryption routine into
your backups, especially when using any external provider.
Other options:
I used rdiff-backup[3] for a while and it is generally very good,
however, it has it's own format of backup files, and it is very
dependent on completing a full run everytime, and failures are disastrous.
At one time, the command '--list-increments-sizes' could never be
completed, and this convinced me I am looking for something less fancy.
In addition, removing a huge directory that snuck in by mistake is
nearly impossible, and you are stuck with it until it is phased out
as old.
There are quite a lot of other options, like rsnapshot[4] or
duplicity[5]. They are all good - choose whatever fits your needs.
[3] http://rdiff-backup.nongnu.org/
[4] http://rsnapshot.org
[5] http://www.nongnu.org/duplicity/
Backup providers:
All you need is ssh access and rsync to be installed at the remote
side. This is very common, and I doubt if you will find a backup
provider that does not give you these.
I use rsync.net[6], which are very friendly, and give great value
for the money. However, use any service that rsync works with (I
believe Amazon s3 is not on this list).
[6] http://rsync.net
Suggestions, Questions:
send me an email (see LICENSE file), or use github.