Define 'backed up' for depositories, and talk a bit about repos.
Chris Pressey
6 years ago
19 | 19 | A subject is expected to have the same content in all the different depositories |
20 | 20 | in which it appears. (This is not 100% true, but it's useful to think of them |
21 | 21 | this way.) |
22 | ||
23 | Because subjects are hierarchical, it is also possible to think of (and treat) | |
24 | a subject as a sort of sub-depository. | |
25 | 22 | |
26 | 23 | There are three kinds of depositories: |
27 | 24 | |
54 | 51 | (perhaps because the filesystem on which the canonical depository is stored |
55 | 52 | is not available at the moment) but which are intended to be put there soon. |
56 | 53 | |
57 | There are two important actions on depositories. | |
54 | With these definitions, we can say that a canonical depository is _backed up_ | |
55 | if and only if every subject in it exists in at least one cache depository | |
56 | which resides on a different physical medium than the canonical depository. | |
57 | ||
58 | Note that two partitions on the same hard disk are *not* different physical | |
59 | media! | |
60 | ||
61 | The goal of the backup system is that every interesting file is in a canonical | |
62 | depository, and that every canonical depository is backed up. | |
63 | ||
64 | To accomplish this goal, there are two important actions on depositories. | |
58 | 65 | |
59 | 66 | ### Update a cache depository from a canonical depository ### |
60 | 67 | |
80 | 87 | |
81 | 88 | but incorporates some consistency checking, i.e. that you don't trample |
82 | 89 | something in the canonical depository with something in the incoming with the |
83 | same name. | |
90 | same name. (Also, `rsync` is pretty picky about directory names, and if | |
91 | you forget the trailing slash, bad things can happen. So it helps there too.) | |
84 | 92 | |
85 | 93 | The `deposit` tool takes an additional flag, `--clean`, which deletes all the |
86 | 94 | files (but not the directories) in the incoming depository after they are |
89 | 97 | |
90 | 98 | It is an excellent idea to update a cache depository from the canonical |
91 | 99 | depository after running `deposit` (and before running `deposit --clean`.) |
100 | ||
101 | ### Advanced Topics in Backup Subjects ### | |
102 | ||
103 | Because subjects are hierarchical, it is also possible to think of (and treat) | |
104 | a subject as a sort of sub-depository. | |
105 | ||
106 | It is up to you to decide if you have any backup use cases that are complex | |
107 | enough to justify doing that. | |
108 | ||
109 | It is also useful to keep certain backups in version-controlled repositories, | |
110 | e.g. git repos. In this case, a repo directory can usually be treated as | |
111 | a subject. Instead of depositing files with `deposit`, one can push changes | |
112 | to the repo-subject residing in the canonical depository. | |
113 | ||
114 | ### Read-only Depositories ### | |
115 | ||
116 | Need to research this, but the basic idea would be to `chmod -R` a | |
117 | cache depository so that you don't accidentally change files in it | |
118 | or add files to it. (But then changing the permissions back when you | |
119 | need to update it from a canonical depository.) | |
92 | 120 | |
93 | 121 | Additional tools |
94 | 122 | ---------------- |