PageRenderTime 59ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

/doc/user-guide.sgml

http://github.com/sukria/Backup-Manager
Unknown | 2014 lines | 1612 code | 402 blank | 0 comment | 0 complexity | a2bc32ddbb304c40d440e5606dcfafc9 MD5 | raw file
Possible License(s): GPL-2.0
  1. <!DOCTYPE debiandoc PUBLIC "-//DebianDoc//DTD DebianDoc//EN" [
  2. <!-- include version information so we don't have to hard code it
  3. within the document -->
  4. <!ENTITY % versiondata SYSTEM "version.ent"> %versiondata;
  5. <!-- common, language independent entities -->
  6. <!ENTITY % commondata SYSTEM "common.ent" > %commondata;
  7. <!-- if you are translating this document, please notate the CVS
  8. revision of the original developer's reference in cvs-en-rev -->
  9. <!-- <!ENTITY cvs-en-rev "X.YZW"> -->
  10. <!-- how to mark a section that needs more work -->
  11. <!ENTITY FIXME "<em>FIXME:</em>&nbsp;">
  12. ]>
  13. <!-- Template of a configuration key description
  14. Please, follow this template for *each* configuration key
  15. this will allow us to make a nice appendix later, think of our
  16. users ;-)
  17. <sect1 id="BM_MYCONFIGURATION_KEY"><tt>BM_MYCONFIGURATION_KEY</tt>
  18. <p>
  19. <em>Type: TYPE, default: <tt>DEFAULT</tt>.</em>
  20. <p>
  21. Description
  22. <p>
  23. Example:
  24. <example>
  25. </example>
  26. -->
  27. <debiandoc>
  28. <book>
  29. <title>&bmngr; &bmngr-version; User Guide
  30. <author>Alexis Sukrieh
  31. <version>&version; - &date-en;
  32. <copyright>
  33. <copyrightsummary>
  34. copyright &copy; 2010 Alexis Sukrieh
  35. </copyrightsummary>
  36. <p>
  37. This user guide is free software; you may redistribute it and/or modify it
  38. under the terms of the GNU General Public License as published by the
  39. Free Software Foundation; either version 2, or (at your option) any
  40. later version.
  41. <p>
  42. This is distributed in the hope that it will be useful, but
  43. <em>without any warranty</em>; without even the implied warranty of
  44. was merchantability or fitness for a particular purpose. See the GNU
  45. General Public License for more details.
  46. <p>
  47. A copy of the GNU General Public License is available on the World Wide
  48. Web at <url id="&url-gpl;" name="the GNU web site">. You can also obtain
  49. it by writing to the &fsf-addr;.
  50. <toc detail="sect1">
  51. <chapt id="about">About this manual
  52. <sect id="about-scope">Scope
  53. <p>
  54. &bmngr; is a system tool designed to handle backups. It is written with
  55. simplicity in mind.
  56. <p>
  57. If you want to handle a couple of tarballs, reading the
  58. default configuration file might be enough to understand the main design.
  59. On the other hand, if you want to know more about the global design of the
  60. program, how to write your own backup methods or even look at some real life
  61. examples, this guide is for you.
  62. <p>
  63. This document describes the main design of the software and gives information
  64. about supported configuration keys. All backup methods are described, with
  65. a sample configuration file as illustration. Whenever possible, advices and best
  66. practices are given.
  67. <p>
  68. This manual also describes every configuration variables supported in the
  69. version &bmngr-version;.
  70. <sect id="about-version">Version
  71. <p>
  72. This document is updated whenever a new release of &bmngr; is published.
  73. The current version covers all features and configuration details about version &bmngr-version;.
  74. <p>
  75. The first version of this document was written with the release 0.6 of &bmngr;.
  76. <sect id="about-authors">Authors
  77. <p>
  78. The first version of this document was made in late 2005, by Alexis Sukrieh and
  79. has been reviewed by Sven Joachim.
  80. <p>
  81. While the author of this document has tried hard to avoid typos and other
  82. errors, these do still occur. If you discover an error in this manual or if you
  83. want to give any comments, suggestions, or criticisms please create a new issue
  84. at https://github.com/sukria/Backup-Manager/issues
  85. <chapt id="configuration">Configuration files
  86. <p>
  87. <em>&bmngr;'s behaviour is defined in configuration files. You can run &bmngr;
  88. with different configuration files (at the same time or not). This chapter will
  89. cover all the configuration keys supported in version &bmngr-version; and will
  90. explain their meaning.</em>
  91. <sect id="design">Repository and Archives
  92. <p>
  93. &bmngr; stores <em>archives</em> it builds in a <em>repository</em>.
  94. <em>Archives</em> are built by using a <em>backup method</em>.
  95. <sect1 id="archive-repo">The Repository
  96. <!-- -->
  97. <sect2 id="BM_REPOSITORY_ROOT"><tt>BM_REPOSITORY_ROOT</tt>
  98. <p>
  99. <em>Type: string, default: <tt>/var/archives</tt>.</em>
  100. <p>
  101. The repository is the place in your filesystem
  102. where all archives are stored.
  103. This is a particular place for &bmngr;, it will be cleaned during backup
  104. sessions: archives older than the authorized lifetime will be purged.
  105. If the repository does not exist, it will be created at runtime.
  106. <p>
  107. Isolating the repository on a dedicated partition is a good idea. This can
  108. prevent the repository from eating all the disk space of the partition.
  109. With a bad configuration file, backup sessions can lead to huge archives,
  110. for many reasons, so take care.
  111. <p>
  112. Example:
  113. <example>
  114. export BM_REPOSITORY_ROOT="/var/archives"
  115. </example>
  116. <sect2 id="BM_REPOSITORY_SECURE"><tt>BM_REPOSITORY_SECURE</tt>
  117. <p>
  118. <em>Type: boolean, default: <tt>true</tt>.</em>
  119. <p> For security reasons, the repository can be accessible by a specific
  120. user/group pair. This will prevent the archives from being readable (and
  121. writable) by any user in the system. This mode is enabled by default (owned by
  122. <tt>root:root</tt>).
  123. <p> To enable this mode, set the configuration key <tt>BM_REPOSITORY_SECURE</tt>
  124. to <tt>yes</tt>, then update <tt>BM_REPOSITORY_USER</tt> and
  125. <tt>BM_REPOSITORY_GROUP</tt> to your needs.
  126. <p>
  127. You can also change the permission of the repository and the archives, that is
  128. possible with two configuration variables: <tt>BM_REPOSITORY_CHMOD</tt> and
  129. <tt>BM_ARCHIVE_CHMOD</tt>.
  130. <p>
  131. Example:
  132. <example>
  133. export BM_REPOSITORY_SECURE="true"
  134. export BM_REPOSITORY_USER="root"
  135. export BM_REPOSITORY_GROUP="root"
  136. export BM_REPOSITORY_CHMOD="770"
  137. export BM_ARCHIVE_CHMOD="660"
  138. </example>
  139. <sect1 id="encryption">Encryption
  140. <p>
  141. <em>
  142. If you cannot trust the place where you store your archives, you can choose to
  143. encrypt them so you are the only one who can read their content.
  144. That's a very good idea for archives you plan to upload to some remote place,
  145. or even for the archives you want to daily export on removable media.
  146. </em>
  147. <sect2 id="BM_ENCRYPTION_METHOD"><tt>BM_ENCRYPTION_METHOD</tt>
  148. <p>
  149. <em>Type: string, default: undefined.</em>
  150. <p>
  151. For &bmngr;, encryption is defined in one place in the configuration file.
  152. If the variable "<tt>BM_ENCRYPTION_METHOD</tt>" is not defined, no encryption occurs
  153. during the archive build process, if a method is defined there, then any
  154. archive built are encrypted through a pipeline with that method.
  155. <p>
  156. Be aware that encryption is supported for the methods "mysql", "pipe",
  157. "tarball" and "tarball-incremental" but only for those file types:
  158. tar, tar.gz, tar.bz2.
  159. <p>
  160. The only valid method supported for encrypting archives is "gpg".
  161. <p>
  162. &bmngr; will encrypt your archive through a pipeline in order not to write any
  163. byte of unencrypted data on the physical media. The encryption will be
  164. performed with a command line like the following:
  165. <example>
  166. &lt;command&gt; | gpg -r "$BM_ENCRYPTION_RECIPIENT" -e > archive.gpg
  167. </example>
  168. <p>
  169. To decrypt an archive built with GPG encryption, you have to be the owner of
  170. the private GPG key for which the encryption was made.
  171. Then issue the following:
  172. <example>
  173. $ gpg -d &lt;archive.gpg&gt; > archive
  174. </example>
  175. <p>
  176. GPG will then prompt you for the private key passphrase and will decrypt the
  177. content of the archive if the passphrase is valid.
  178. <p>
  179. Refer to the GPG documentation for more details of encryption.
  180. <sect2 id="BM_ENCRYPTION_RECIPIENT"><tt>BM_ENCRYPTION_RECIPIENT</tt>
  181. <p>
  182. <em>Type: string, default: undefined.</em>
  183. <p>
  184. As explained in the previous section, that variable should contain the GPG
  185. recipient for the encryption, eg: your GPG ID.
  186. <p>
  187. Examples of valid GPG ID:
  188. <example>
  189. export BM_ENCRYPTION_RECIPIENT="0x1EE5DD34"
  190. export BM_ENCRYPTION_RECIPIENT="Alexis Sukrieh"
  191. export BM_ENCRYPTION_RECIPIENT="sukria@sukria.net"
  192. </example>
  193. <sect1 id="archives">Archives
  194. <p>
  195. <em>Archives are produced by backup methods, they can be virtually anything, but
  196. will always be named like the following: <tt>prefix-name-date.filetype</tt>. An
  197. archive is a file that contains data, it can be compressed or not, in a binary
  198. form or not.</em>
  199. <sect2 id="BM_ARCHIVE_STRICTPURGE"><tt>BM_ARCHIVE_STRICTPURGE</tt>
  200. <p>
  201. <em>Type: boolean, default: <tt>true</tt>.</em>
  202. <p>
  203. As explained in the BM_REPOSITORY_ROOT section, every archive built by &bmngr; will
  204. be purged when their lifetime expires. In versions prior to 0.7.6, any archive
  205. were purged.
  206. <p>
  207. You can now choose to purge only the archive built in the scope of the
  208. configuration file, that is: archives prefixed with BM_ARCHIVE_PREFIX.
  209. <p>
  210. This is useful if you share the same BM_REPOSITORY_ROOT with different instances
  211. of &bmngr; that have different purging rules (eg: a BM_REPOSITORY_ROOT shared
  212. over NFS for multiple &bmngr; configuration).
  213. <p>
  214. Example:
  215. <example>
  216. export BM_ARCHIVE_STRICTPURGE="true"
  217. </example>
  218. <sect2 id="BM_ARCHIVE_NICE_LEVEL"><tt>BM_ARCHIVE_NICE_LEVEL</tt>
  219. <p>
  220. <em>Type: string, default: <tt>10</tt>.</em>
  221. <p>
  222. Backup Manager does handle several archive methods, which can use a lot of ressources
  223. (mostly CPU); although this can be acceptable if Backup Manager is run at night, on a
  224. always-running server, it can seriously slow-down a desktop computer.
  225. Indeed, most of the time, desktop users use anacron to run backup-manager when possible,
  226. and most of time this is when the desktop is actually used.
  227. <p>
  228. To enhance the desktop-experience when archives are built,
  229. you can adjust the niceness used for archive creation with this configuration variable.
  230. <p>
  231. To set a low priority to the archive creation processes, use a high number (max: 19).
  232. See the manpage of nice for details.
  233. <p>
  234. Example:
  235. <example>
  236. export BM_ARCHIVE_NICE_LEVEL="19" # recommanded for desktop users.
  237. </example>
  238. <sect2 id="BM_ARCHIVE_PURGEDUPS"><tt>BM_ARCHIVE_PURGEDUPS</tt>
  239. <p>
  240. <em>Type: boolean, default: <tt>true</tt>.</em>
  241. <p>
  242. If disk usage matters in your backup strategy, you might find useful to use
  243. &bmngr;'s duplicates purging feature. When an archive is generated, &bmngr;
  244. looks at the previous versions of this archive. If it finds that a previous
  245. archive is the same file as the one it has just built, the previous one is
  246. replaced by a symlink to the new one. This is useful if you don't want to have
  247. the same archive twice in the repository.
  248. <p>
  249. Example:
  250. <example>
  251. export BM_ARCHIVE_PURGEDUPS="true"
  252. host-etc.20051115.tar.gz
  253. host-etc.20051116.tar.gz -> /var/archives/host-etc.20051117.tar.gz
  254. host-etc.20051117.tar.gz
  255. </example>
  256. <sect2 id="BM_ARCHIVE_TTL"><tt>BM_ARCHIVE_TTL</tt>
  257. <p>
  258. <em>Type: integer, default: <tt>5</tt>.</em>
  259. <p>
  260. One of the main concepts behind the handling of the repository is to purge
  261. deprecated archives automatically. The purge session is always performed
  262. when you launch &bmngr;. During this phase, all archives older than the
  263. authorized lifetime are dropped.
  264. <p>
  265. Since version 0.7.3, &bmngr; purges only files it has created whereas in previous
  266. versions, it used to purge also other files within the repository.
  267. <p>
  268. Note that when using the incremental method for building archives, &bmngr; will
  269. handle differently master backups and incremental ones. The incremental backups
  270. will be purged like any other archives (when exceeding the authorized lifetime).
  271. On the ohter hand, deprecated master backups won't be purged unless there is a
  272. younger master backup in the repository. Then, even with a lifetime set to three
  273. days, a master backup will live more than three days, until a newer master
  274. backup is built.
  275. <p>
  276. Example:
  277. <example>
  278. export BM_ARCHIVE_TTL="5"
  279. </example>
  280. <sect2 id="BM_REPOSITORY_RECURSIVEPURGE"><tt>BM_REPOSITORY_RECURSIVEPURGE</tt>
  281. <p>
  282. <em>Type: boolean, default: <tt>false</tt>.</em>
  283. <p>
  284. On most setups, all the archives are stored in the top-level directory
  285. specified by the configuration key <tt>BM_REPOSITORY_ROOT</tt>. But it can make
  286. sense to have subdirectories, for instance to store archives uploaded from
  287. other hosts running &bmngr;. In this case, it is possible to ask &bmngr; to
  288. purge those directories too, by setting <tt>BM_REPOSITORY_RECURSIVEPURGE</tt>
  289. to <tt>true</tt>.
  290. <p>
  291. Please note that the <tt>BM_ARCHIVE_TTL</tt> value is global, so if you want to
  292. have different lifetimes for some archives, this is not the way to go. In this
  293. case you should save them outside <tt>BM_REPOSITORY_ROOT</tt> and write a cron
  294. job to do the purge (possibly calling <tt>backup-manager --purge</tt> with an
  295. alternate configuration file).
  296. <p>
  297. Example:
  298. <example>
  299. export BM_REPOSITORY_RECURSIVEPURGE="false"
  300. </example>
  301. <sect2 id="BM_ARCHIVE_PREFIX"><tt>BM_ARCHIVE_PREFIX</tt>
  302. <p>
  303. <em>Type: string, default: <tt>$HOSTNAME</tt>.</em>
  304. <p>
  305. This is the prefix used for naming archives.
  306. <p>
  307. Example:
  308. <example>
  309. export BM_ARCHIVE_PREFIX="$HOSTNAME"
  310. # echo $HOSTNAME
  311. ouranos
  312. # ls /var/archives
  313. ouranos-20051123.md5
  314. ouranos-usr-local-src.20051123.tar.gz
  315. ouranos-etc.20051123.tar.gz
  316. </example>
  317. <sect id="methods">Backup Methods
  318. <p>
  319. The core feature of &bmngr; is to make archives, for doing this, a
  320. <em>method</em> is used. Each method can require a set of configuration keys.
  321. We will describe here every method supported in the version &bmngr-version;.
  322. <p>
  323. The method you choose must be defined in the configuration key
  324. <tt>BM_ARCHIVE_METHOD</tt>. You can put here a list of all the different methods
  325. you want to use. Take care to put every configuration key needed by all the
  326. methods you choose.
  327. Note that you can also choose none of the proposed methods, if you don't want
  328. to build archives with this configuration file, then just put <tt>none</tt>.
  329. <p>
  330. A couple of other configuration keys may be needed depending on the method you
  331. choose.
  332. <p>
  333. Example:
  334. <example>
  335. export BM_ARCHIVE_METHOD="tarball-incremental mysql"
  336. </example>
  337. <sect1 id="tarball">Tarballs
  338. <sect2 id="tarball-desc">Description
  339. <p>
  340. <em>Method name: <tt>tarball</tt>, configuration key prefix: <tt>BM_TARBALL</tt>.</em>
  341. <p>
  342. If all you want to do is to handle a couple of tarballs of your file system, you
  343. can use this method. This method takes a list of directories
  344. and builds the corresponding tarballs.
  345. This method is the default one, this is the easiest to use, it just
  346. builds tarballs as you could do with your own tar script. Its main drawback is
  347. to eat a lot of disk space: archives can be big from a day to another, even if
  348. there are no changes in their content. See the <tt>tarball-incremental</tt>
  349. method if you want to optimize archives' size.
  350. <p>
  351. When building full backups (when not building incremental ones), &bmngr; will append
  352. the keyword "master" to the name of the archive. This is very useful when using
  353. the <tt>tarball-incremental</tt> method for seeing where the full backups are quickly.
  354. <p>
  355. A couple of options are available: the name format
  356. of the archive, the compression type (gzip, zip, bzip2, none) and the
  357. facility to dereference symlinks when building the tarball.
  358. <sect2 id="BM_TARBALL_NAMEFORMAT"><tt>BM_TARBALL_NAMEFORMAT</tt>
  359. <p>
  360. This configuration key defines how to perform the naming of the archive. Two
  361. values are possible:
  362. <list>
  363. <item><tt>long</tt>: the name will be made with the absolute path of the directory
  364. (eg: <tt>var-log-apache</tt> for <tt>/var/log/apache</tt>).
  365. <item><tt>short</tt>: the name will just contain the directory (eg:
  366. <tt>apache</tt> for <tt>/var/log/apache</tt>).
  367. </list>
  368. <p>
  369. Suggested value: <tt>long</tt>.
  370. <sect2 id="BM_TARBALL_FILETYPE"><tt>BM_TARBALL_FILETYPE</tt>
  371. <p>
  372. <em>Type: enum(tar, tar.gz, tar.bz2, tar.lz, zip, dar), default: <tt>tar.gz</tt>.</em>
  373. <p>
  374. Basically, this configuration key defines the filetype of the resulting archive.
  375. In a way, it defines which compressor to use (zip, gzip, dar or bzip2).
  376. Here are the supported values: <tt>tar</tt>, <tt>tar.gz</tt>, <tt>tar.bz2</tt>,
  377. <tt>zip</tt> and <tt>dar</tt>.
  378. Note that depending on the filetype you choose, you will have to
  379. make sure you have the corresponding compressor installed.
  380. <p>
  381. For the best compression rate, choose <tt>tar.bz2</tt> or <tt>tar.lz</tt>.
  382. <p>
  383. Since version 0.7.1, &bmngr; supports <em>dar</em> archives. This archiver
  384. provides some interesting features like the archive slicing.
  385. <p>
  386. Since version 0.7.5, &bmngr; supports <em>lzma</em> archives.
  387. <p>
  388. Make sure to statisfy dependencies according to the filetype you choose:
  389. <list>
  390. <item> tar.bz2 : needs "bzip2".
  391. <item> tar.lz : needs "lzma".
  392. <item> dar : needs "dar".
  393. <item> zip : needs "zip".
  394. </list>
  395. <sect2 id="BM_TARBALL_SLICESIZE"><tt>BM_TARBALL_SLICESIZE</tt>
  396. <p>
  397. <em>Type: string</em>
  398. <p>
  399. If you want to make sure your archives won't exceed a given size (for instance 2
  400. GB) you can use that configuration variable, but only if you are using the
  401. <tt>dar</tt> <tt>BM_TARBALL_FILETYPE</tt>. Indeed this feature is only supported
  402. by dar.
  403. <p>
  404. If you want to limit your archives size to 1 giga byte, use such a statement:
  405. <example>
  406. BM_TARBALL_SLICESIZE="1000M"
  407. </example>
  408. <p>
  409. Refer to the dar manpage for details about slices.
  410. <sect2 id="BM_TARBALL_EXTRA_OPTIONS"><tt>BM_TARBALL_EXTRA_OPTIONS</tt>
  411. <p>
  412. <em>Type: string</em>
  413. <p>
  414. If you want to provide extra options to "tar" or "dar" you may do so
  415. here. Leave blank unless you know what you are doing.
  416. <p>
  417. Example: to enable verbosity with tar (which would appeard in the logfiles), use this:
  418. <example>
  419. BM_TARBALL_EXTRA_OPTIONS="-v"
  420. </example>
  421. <sect2 id="BM_TARBALL_DUMPSYMLINKS"><tt>BM_TARBALL_DUMPSYMLINKS</tt>
  422. <p>
  423. <em>Type: boolean, default: <tt>true</tt>.</em>
  424. <p>
  425. It is possible, when generating the tarball (or the zip file) to dereference the
  426. symlinks. If you enable this feature, every symbolic link in the file system
  427. will be replaced in the archive by the file it points to. Use this feature with
  428. care, it can quickly lead to huge archives, or even worse: if you have a
  429. circular symlink somewhere, this will lead to an infinite archive!
  430. <p>
  431. In most of the cases, you should not use this feature.
  432. <sect2 id="BM_TARBALL_DIRECTORIES"><tt>BM_TARBALL_DIRECTORIES</tt>
  433. <p>
  434. <em>Type: space-separated list, default: <tt>null</tt>.</em>
  435. <p>
  436. Since version 0.7.3, this variable is replaced by the array BM_TARBALL_TARGETS[],
  437. it's still supported for backward compatibility though.
  438. You can use this variable for defining the locations to backup, but you must not
  439. use this variable if one or more of the paths you want to archive contain a space.
  440. <p>
  441. If you want to backup some targets that have spaces in their name (eg
  442. "Program Files"), you must not use this variable, but the array
  443. BM_TARBALL_TARGETS[] instead.
  444. <p>
  445. Example:
  446. <example>
  447. export BM_TARBALL_DIRECTORIES="/etc /home /var/log/apache"
  448. </example>
  449. <sect2 id="BM_TARBALL_TARGETS"><tt>BM_TARBALL_TARGETS</tt>
  450. <p>
  451. <em>Type: array, default: <tt>"/etc", "/boot"</tt>.</em>
  452. <p>
  453. This variable holds every place you want to backup. This is the recommanded
  454. variable to use for defining your backup targets (<tt>BM_TARBALL_DIRECTORIES</tt> is
  455. deprecated since version 0.7.3).
  456. <p>
  457. You can safely put items that contain spaces (eg: "Program Files") whereas you
  458. can't with <tt>BM_TARBALL_DIRECTORIES</tt>.
  459. <p>
  460. You can also put Bash patterns in BM_TARBALL_TARGETS[], it will be expanded at
  461. runtime to find the resulting targets. For instance :
  462. BM_TARBALL_TARGETS[0]="/home/*" will lead to backup every home's sub-directory.
  463. <p>
  464. Example
  465. <example>
  466. BM_TARBALL_TARGETS[0]="/etc"
  467. BM_TARBALL_TARGETS[1]="/home/*"
  468. BM_TARBALL_TARGETS[2]="/boot"
  469. BM_TARBALL_TARGETS[3]="/mnt/win/Program Files"
  470. </example>
  471. <sect2 id="BM_TARBALL_BLACKLIST"><tt>BM_TARBALL_BLACKLIST</tt>
  472. <p>
  473. <em>Type: space-separated list, default: <tt>"/proc /dev /sys /tmp"</tt>.</em>
  474. <p>
  475. It can be very useful to prevent some locations of your filesytem from being
  476. included in the archives. This is really useful when you use wildcards in
  477. BM_TARBALL_DIRECTORIES. Indeed, you may want to backup every top-level directory
  478. of your filesystem (<tt>/*</tt>) but without volatile locations like
  479. <tt>/tmp</tt>, <tt>/dev</tt> and <tt>/proc</tt>.
  480. <p>
  481. You can also use this variable for excluding every files of a given extension,
  482. like for instance mp3 or mpg files.
  483. <p>
  484. Example:
  485. <example>
  486. export BM_TARBALL_BLACKLIST="/tmp /dev /proc *.mp3 *.mpg"
  487. </example>
  488. <sect2 id="BM_TARBALL_OVER_SSH"><tt>BM_TARBALL_OVER_SSH</tt>
  489. <p>
  490. <em>Type: boolean, default: <tt>false</tt>.</em>
  491. <p>
  492. <strong>Dependency: <tt>BM_UPLOAD_SSH</tt></strong>
  493. <p>
  494. If you want to archive some remote locations from a server where &bmngr; is insalled, you can choose to
  495. build archives over SSH. This is useful if you don't want to install &bmngr; every where and setup some
  496. upload methods from all thoses servers to a central data storage server.
  497. This way, &bmngr; will build some archives directly over SSH and will store the resulting tarballs locally,
  498. as if it was built like any other archive. The resulting archive will be prefixed with the remote hostname
  499. instead of <tt>BM_ARCHIVE_PREFIX</tt>.
  500. <p>
  501. This feature requires that the following variables are set in the BM_UPLOAD_SSH section:
  502. <list>
  503. <item><tt>BM_UPLOAD_SSH_USER</tt>: the user to use for connecting to the remote server. Note
  504. that this user will run tar remotely, so take care to archive something this user can read!
  505. <item><tt>BM_UPLOAD_SSH_KEY</tt>: as usal, the path to the private key to use for establishing the connection.
  506. <item><tt>BM_UPLOAD_SSH_HOSTS</tt>: A list of hosts where to run the tarball builds.
  507. </list>
  508. <p>
  509. If you enable this feature, note that the resulting configuration file will have the following restrictions:
  510. <list>
  511. <item>Remote tarball build only works with the <tt>tarball</tt> method, it will silently behaves the same
  512. with <tt>tarball-incremental</tt>.
  513. <item>You cannot use the remote build and the local one in the same configuration file. If you want to do both,
  514. use two configuration files.
  515. </list>
  516. <p>
  517. Example: You have three hosts: host01, host02 and host03. You want to set up
  518. host01 as a data storage server, it has a big /var/archives partition. You want
  519. to archive "/etc", "/home" and "/var/log" on box02 and box03 and store the archives on
  520. host01.
  521. <example>
  522. [...]
  523. export BM_ARCHIVE_METHOD="tarball"
  524. export BM_TARBALL_OVER_SSH="true"
  525. export BM_TARBALL_FILETYPE="tar.bz2"
  526. export BM_TARBALL_DIRECTORIES="/etc /home /var/log"
  527. export BM_UPLOAD_SSH_USER="bamuser"
  528. export BM_UPLOAD_SSH_KEY="/home/bamuser/.ssh/id_dsa"
  529. export BM_UPLOAD_SSH_HOSTS="box02 box03"
  530. </example>
  531. Of course, for this to work correctly, <tt>`bamuser'</tt> should be a valid user on box02
  532. and box03; it must be allowed to connect to them with SSH key autentication and
  533. has to be able to read those directories.
  534. <sect1 id="tarballinc">Incremental tarballs
  535. <sect2 id="tarballinc-desc">Description
  536. <p>
  537. <em>Method name: <tt>tarball-incremental</tt>, configuration key prefix:
  538. <tt>BM_TARBALLINC</tt>.</em>
  539. <p>
  540. If you want to handle tarballs without wasting disk space, you should use this
  541. method. The concept of this method is simple: You choose a frequency when a full
  542. backup is made (exactly like the one made by the tarball mehod). All the days
  543. between two full backups, archives contain only the files that have changed from
  544. the previous archive.
  545. <p>
  546. For instance, let's say you want to backup /home with this method. Your /home
  547. directory is composed by two sub-directories: /home/foo and /home/bar.
  548. You choose a weekly frequency and say that monday will be the "fullbackup" day.
  549. Obviously, you will have a full tarball of /home on monday.
  550. Then, if a file changed inside /home/foo and if /home/bar
  551. remains unchanged, tuesday's archive will only contain the modified files of
  552. /home/foo. Using this method will save a lot of disk space.
  553. <p>
  554. To build incremental tarballs, &bmngr; uses tar's switch
  555. <tt>--listed-incremental</tt>. This will create a file for each target which
  556. will contain some statistics used by tar to figure out if a file should be
  557. backed up or not.
  558. When &bmngr; is run for the first time, this file doesn't exist, so the first
  559. tarballs made are always master backups.
  560. If the <em>incremental list</em> files get removed, the next backups won't be
  561. incremental.
  562. <p>
  563. Since version 0.7.3, it's possible to see at the first glance if a backup is
  564. a master or an incremental one: master backup have the keyword <tt>master</tt>
  565. appended to the date.
  566. When purging the repository, the master backups are not removed as the
  567. incremental ones. &bmngr; always keep a master backup that is older than
  568. incremental archives.
  569. <p>
  570. This method uses all the tarball's configuration keys and adds two more. One to
  571. define the kind of frequency, the other to choose on which day the full backups
  572. should be done.
  573. <sect2 id="BM_TARBALLINC_MASTERDATETYPE"><tt>BM_TARBALLINC_MASTERDATETYPE</tt>
  574. <p>
  575. <em>Type: enum(weekly, monthly), default: <tt>weekly</tt>.</em>
  576. <p>
  577. This is the type of frequency you want to use. If you choose <tt>weekly</tt>,
  578. you'll have to choose a day number between 0 and 6 for the
  579. BM_TARBALLINC_MASTERDATEVALUE configuration key, if you choose <tt>monthly</tt>,
  580. the day number will be between 1 and 31.
  581. <sect2 id="BM_TARBALLINC_MASTERDATEVALUE"><tt>BM_TARBALLINC_MASTERDATEVALUE</tt>
  582. <p>
  583. <em>Type: integer, default: <tt>1</tt>.</em>
  584. <p>
  585. The number of the day when making full backups. Note that its meaning directly
  586. depends on the <tt>BM_TARBALLINC_MASTERDATETYPE</tt>.
  587. For instance, 1 means <em>"monday"</em> if you
  588. choose a weekly frequency, but it means <em>"the first day of the month"</em>
  589. if you choose a monthly frequency.
  590. <sect1 id="mysql">MySQL databases
  591. <sect2 id="mysql-desc">Description
  592. <p>
  593. <em>Method name: <tt>mysql</tt>, configuration keys prefix:
  594. <tt>BM_MYSQL</tt>.</em>
  595. <p>
  596. This method provides a way to archive MySQL databases, the archives are made with
  597. mysqldump (SQL text files) and can be compressed.
  598. <p>
  599. In versions prior to 0.7.6, &bmngr; used to pass the MySQL client's password through
  600. the command line. As explained by the MySQL manual, that's a security issue as
  601. the password is then readable for a short time in the /proc directory (or using
  602. the ps command).
  603. <p>
  604. To close that vulnerability, the MySQL client password is not passed through
  605. the command line anymore, it is written in a configuration file located in the
  606. home directory of the user running &bmngr; : <tt>~/.my.cnf</tt>.
  607. <p>
  608. If that file doesn't exist at runtime, &bmngr; will create it and will then
  609. write the password provided in <tt>BM_MYSQL_ADMINPASS</tt> inside.
  610. <sect2 id="BM_MYSQL_DATABASES"><tt>BM_MYSQL_DATABASES</tt>
  611. <p>
  612. <em>Type: space-separated list, default: <tt>__ALL__</tt>.</em>
  613. <p>
  614. This is the list of databases you want to archive.
  615. You can put the keyword <tt>__ALL__</tt> if you like to backup every database without
  616. having to list them.
  617. <p>
  618. Example:
  619. <example>
  620. export BM_MYSQL_DATABASES="mysql mybase wordpress dotclear phpbb2"
  621. </example>
  622. <sect2 id="BM_MYSQL_SAFEDUMPS"><tt>BM_MYSQL_SAFEDUMPS</tt>
  623. <p>
  624. <em>Type: boolean, default: <tt>true</tt>.</em>
  625. <p>
  626. The best way to produce MySQL dumps is done by using mysqldump's <tt>--opt</tt> switch.
  627. This makes the dump directly usable with mysql (adds the drop table
  628. statements), locks tables during the dump generation and other cool things (see <tt>mysqldump</tt>).
  629. This is recommended for full-clean-safe backups, but needs a
  630. privileged user (for the lock permissions).
  631. <p>
  632. Example:
  633. <example>
  634. export BM_MYSQL_SAFEDUMPS="true"
  635. </example>
  636. <sect2 id="BM_MYSQL_ADMINLOGIN"><tt>BM_MYSQL_ADMINLOGIN</tt>
  637. <p>
  638. <em>Type: string, default: <tt>root</tt>.</em>
  639. <p>
  640. The MySQL login you want to use for connecting to the database. Make sure this login
  641. can read all the databases you've set in <tt>BM_MYSQL_DATABASES</tt>.
  642. <p>
  643. Example:
  644. <example>
  645. export BM_MYSQL_ADMINLOGIN="root"
  646. </example>
  647. <sect2 id="BM_MYSQL_ADMINPASS"><tt>BM_MYSQL_ADMINPASS</tt>
  648. <p>
  649. <em>Type: string, default: <tt>undefined</tt>.</em>
  650. <p>
  651. The MySQL client password.
  652. <p>
  653. If you have already made your own ~/.my.cnf configuration file, you don't have
  654. to set that variable.
  655. <p>
  656. If you don't know what is the <tt>~/.my.cnf</tt> configuration file, set the password,
  657. then &bmngr; will take care of creating the MySQL client configuration file.
  658. <p>
  659. Example:
  660. <example>
  661. export BM_MYSQL_ADMINPASS="MySecretPass"
  662. </example>
  663. <sect2 id="BM_MYSQL_HOST"><tt>BM_MYSQL_HOST</tt>
  664. <p>
  665. <em>Type: string, default: <tt>localhost</tt>.</em>
  666. <p>
  667. The database host where the databases are.
  668. <p>
  669. Example:
  670. <example>
  671. export BM_MYSQL_HOST="localhost"
  672. </example>
  673. <sect2 id="BM_MYSQL_PORT"><tt>BM_MYSQL_PORT</tt>
  674. <p>
  675. <em>Type: string, default: <tt>3306</tt>.</em>
  676. <p>
  677. The port on <tt>BM_MYSQL_HOST</tt> where the mysql server is listening.
  678. <p>
  679. Example:
  680. <example>
  681. export BM_MYSQL_PORT="3306"
  682. </example>
  683. <sect2 id="BM_MYSQL_FILETYPE"><tt>BM_MYSQL_FILETYPE</tt>
  684. <p>
  685. <em>Type: enum(gzip, bzip2), default: <tt>bzip2</tt>.</em>
  686. <p>
  687. The archive is made with mysqldump which renders SQL lines; the
  688. resulting text file can be compressed.
  689. If you want to compress the file, choose the compressor you want.
  690. Leave it blank if you want pure SQL files.
  691. <p>
  692. Example:
  693. <example>
  694. export BM_MYSQL_FILETYPE="bzip2"
  695. </example>
  696. <sect1 id="svn">Subversion repositories
  697. <sect2 id="svn-desc">Description
  698. <p>
  699. You can archive Subversion repositories with this method. The archive will be
  700. made with <tt>svnadmin</tt> and will contain XML data (text files).
  701. Like the mysql method, you can choose to compress it.
  702. <sect2 id="BM_SVN_REPOSITORIES"><tt>BM_SVN_REPOSITORIES</tt>
  703. <p>
  704. <em>Type: space-separated list</em>
  705. <p>
  706. This is the list of absolute paths to the SVN repositories to archive.
  707. <p>
  708. Example:
  709. <example>
  710. export BM_SVN_REPOSITORIES="/srv/svnroot/repo1 /srv/svnroot/repo2"
  711. </example>
  712. <sect2 id="BM_SVN_COMPRESSWITH"><tt>BM_SVN_COMPRESSWITH</tt>
  713. <p>
  714. <em>Type: enum(gzip, bzip2), default: <tt>bzip2</tt>.</em>
  715. <p>
  716. If you want to compress the resulting XML files, choose a compressor here.
  717. Leave this blank if you don't want any compression.
  718. <p>
  719. Example:
  720. <example>
  721. export BM_SVN_COMPRESSWITH="gzip"
  722. </example>
  723. <sect1 id="pipe">Generic methods
  724. <sect2 id="pipe-desc">Description
  725. <p>
  726. Even if most of the common needs are covered by the existing methods, there is always
  727. a case uncovered. &bmngr; provides a way for backing up anything, and can be used in such
  728. circumstances.
  729. <p>
  730. This method is called <tt>pipe</tt>, it is more complex to use but can virtually backup anything.
  731. The concept is simple, a pipe method is defined by the following items:
  732. <list>
  733. <item>A name (for naming the archive)
  734. <item>A command (that produces content on stdout)
  735. <item>A file type (txt, sql, dump, ...)
  736. <item>A compressor (gzip, bzip2)
  737. </list>
  738. <p>
  739. Those configuration keys are arrays, so you can implement as many pipe methods
  740. as you like.
  741. <p>
  742. For each pipe method defined, &bmngr; will launch the command given and redirect
  743. the content sent to stdout by this command to a file named with the name of the
  744. method and its filetype. Then, if the method uses a compressor, the file will
  745. be compressed.
  746. <sect2 id="pipe-example">Example
  747. <p>
  748. Example for archiving a remote MySQL database through SSH:
  749. <example>
  750. BM_PIPE_COMMAND[0]="ssh host -c \"mysqldump -ufoo -pbar base\""
  751. BM_PIPE_NAME[0]="base"
  752. BM_PIPE_FILETYPE[0]="sql"
  753. BM_PIPE_COMPRESS[0]="gzip"
  754. </example>
  755. <p>
  756. Imagine you have a second pipe method to implement, for instance building
  757. a tarball trough SSH:
  758. <example>
  759. BM_PIPE_COMMAND[1]="ssh host -c \"tar -c -z /home/user\""
  760. BM_PIPE_NAME[1]="host.home.user"
  761. BM_PIPE_FILETYPE[1]="tar.gz"
  762. BM_PIPE_COMPRESS[1]=""
  763. </example>
  764. <p>
  765. Note that we have incremented the array's index.
  766. <sect id="uploads">Upload Methods
  767. <sect1 id="uploads-desc">Description
  768. <p>
  769. <em>One of the most important thing to do when backing up file systems is to store
  770. the archives on different places. The more different physical spaces you have, the better.
  771. &bmngr; provides a way for achieving this goal : the upload methods. </em>
  772. <p>
  773. There are different upload methods, each of them behaves differently and provides particular
  774. features. In &bmngr; &bmngr-version; you can use FTP, SSH, RSYNC or Amazon S3 uploads.
  775. <p>In the same manner as for backup methods, you can choose to use as many
  776. upload methods as you like. If you don't want to use this feature at all, just put
  777. the keyword <tt>none</tt> in the configuration <tt>BM_UPLOAD_METHOD</tt>.
  778. <p>
  779. Note that the FTP, SSH and S3 methods are dedicated to upload archives,
  780. using those method depends on the use of at least one backup method.
  781. <p>
  782. On the opposite, the RSYNC method uploads a directory to remote locations,
  783. this directory can be your repository or whatever other location of your
  784. file sytem.
  785. <sect1 id="uploads-global">Global configuration keys
  786. <p>
  787. The following configuration keys are global in the upload section:
  788. <sect2 id="BM_UPLOAD_HOSTS"><tt>BM_UPLOAD_HOSTS</tt>
  789. <p>
  790. <em>Type: space-separated list</em>
  791. <p>
  792. Each of the hosts defined in that list is used by all the upload methods
  793. when establishing connections. For instance if you want to perform SSH uploads of
  794. your archives and RSYNC upload of a location to the same host, put it in this list.
  795. <p>
  796. Example:
  797. <example>
  798. export BM_UPLOAD_HOSTS="mirror1.lan.mysite.net mirror2.lan.mysite.net"
  799. </example>
  800. <sect2 id="BM_UPLOAD_DESTINATION"><tt>BM_UPLOAD_DESTINATION</tt>
  801. <p>
  802. <em>Type: string</em>
  803. <p>
  804. This is the absolute path of the directory in the remote hosts where to
  805. put the files uploaded.
  806. <p>
  807. If you have installed installed &bmngr; on the remote host,
  808. a good idea is to choose a sub-directory of the repository.
  809. Then, during the remote host purge phase, your uploads will be
  810. cleaned at the same time.
  811. <p>
  812. You can also define a destination dedicated to your host:
  813. <tt>BM_UPLOAD_DESTINATION="/var/archives/$HOSTNAME"</tt>
  814. <p>Example:
  815. <p>
  816. Let's say you want that all your uploads are performed on the host mirror2.lan.mysite.net,
  817. in the sub-directory /var/archives/uploads
  818. <example>
  819. export BM_UPLOAD_HOSTS="mirror2.lan.mysite.net"
  820. export BM_UPLOAD_DESTINATION="/var/archives/uploads"
  821. </example>
  822. <sect1 id="upload-ssh">SSH uploads
  823. <sect2 id="uploads-ssh-desc">Description
  824. <p>
  825. <em>Method name: <tt>ssh</tt>, goal: upload archives to remote hosts over SSH.
  826. This method depends on a backup method.
  827. </em>
  828. <p>
  829. If you want to upload your archives on remote locations, you can use the SSH method.
  830. This method is good if you like to use a secure tunnel between the two points of
  831. the upload.
  832. <p>
  833. The call to <tt>scp</tt> will be done with the identity of the user <tt>BM_UPLOAD_SSH_USER</tt>,
  834. thus, you have to make sure this user can have access to the repository (take care to the secure mode).
  835. <sect2 id="BM_UPLOAD_SSH_USER"><tt>BM_UPLOAD_SSH_USER</tt>
  836. <p>
  837. <em>Type: string</em>
  838. <p>
  839. This is the user to use for performing the ssh connection. Make sure this user can access
  840. repository.
  841. <p>
  842. Example:
  843. <example>
  844. export BM_UPLOAD_SSH_USER="bmngr"
  845. </example>
  846. <sect2 id="BM_UPLOAD_SSH_KEY"><tt>BM_UPLOAD_SSH_KEY</tt>
  847. <p>
  848. <em>Type: string</em>
  849. <p>
  850. This is the path to the private key of the user BM_UPLOAD_SSH_USER.
  851. <p>
  852. Example:
  853. <example>
  854. export BM_UPLOAD_SSH_KEY="/home/bmngr/.ssh/id_dsa"
  855. </example>
  856. <sect2 id="BM_UPLOAD_SSH_PORT"><tt>BM_UPLOAD_SSH_PORT</tt>
  857. <p>
  858. <em>Type: integer</em>
  859. <p>
  860. You may want to connect to remote hosts with a specific port.
  861. Use this configuration key then.
  862. <p>
  863. Example:
  864. <example>
  865. export BM_UPLOAD_SSH_PORT="1352"
  866. </example>
  867. <sect2 id="BM_UPLOAD_SSH_HOSTS"><tt>BM_UPLOAD_SSH_HOSTS</tt>
  868. <p>
  869. <em>Type: space-separated list</em>
  870. <p>
  871. Put here the list of hosts to use for SSH-only uploads.
  872. Note that if you put some hosts in <tt>BM_UPLOAD_HOSTS</tt>, they will be used as well.
  873. <p>
  874. Example:
  875. <example>
  876. export BM_UPLOAD_SSH_HOSTS="mirror3.lan.mysite.net"
  877. </example>
  878. <sect2 id="BM_UPLOAD_SSH_PURGE"><tt>BM_UPLOAD_SSH_PURGE</tt>
  879. <p>
  880. <em>Type: boolean</em>
  881. <p>
  882. If you set this boolean to "true", the remote archives will be purged before
  883. the new ones are uploaded. The purging rules are the same as the ones &bmngr;
  884. uses for local purging. If <tt>BM_UPLOAD_SSH_TTL</tt> is defined, this time to
  885. live will be used, else <tt>BM_ARCHIVE_TTL</tt> will be used.
  886. <p>
  887. Example:
  888. <example>
  889. export BM_UPLOAD_SSH_PURGE="true"
  890. export BM_UPLOAD_SSH_TTL="10"
  891. </example>
  892. <sect2 id="BM_UPLOAD_SSH_DESTINATION"><tt>BM_UPLOAD_SSH_DESTINATION</tt>
  893. <p>
  894. <em>Type: string</em>
  895. <p>
  896. Put here the destination for SSH-only uploads, this key overrides
  897. <tt>BM_UPLOAD_DESTINATION</tt>.
  898. <p>
  899. Example:
  900. <example>
  901. export BM_UPLOAD_SSH_DESTINATION="/var/archives/scp-uploads"
  902. </example>
  903. <sect1 id="upload-ssh-gpg"> Encrypted SSH uploads
  904. <sect2 id="upload-ssh-gpg-desc"> Description
  905. <p>
  906. <em>Method name: <tt>ssh-gpg</tt>, goal: encrypt arcives using public
  907. key encryption and upload the result to untrusted remote hosts
  908. over SSH. This method depends on a backup method. </em>
  909. <p>
  910. The upload using SSH can also be combined with public key encryption
  911. provided by <tt>gpg</tt>. The archives will be encrypted using a
  912. public key prior to sending them over the network, so on the remote
  913. server your files are protected from inspection.
  914. <p>
  915. This method can be used to protect your data from inspection on
  916. untrusted remote servers. However, since the encrypted files are not
  917. signed, this does not protect you from archive manipulation. So the
  918. <em>md5</em> hases are still needed.
  919. <p>
  920. This method uses all of the configuartion keys of the <em>ssh</em> method. One
  921. additional key is required.
  922. <sect2
  923. id="BM_UPLOAD_SSH_GPG_RECIPIENT"><tt>BM_UPLOAD_SSH_GPG_RECIPIENT</tt>
  924. <p>
  925. <em>Type: string</em>
  926. <p>
  927. This parameter sets the recipient for which the archive is
  928. encrypted. A valid specification is a short or long key id, or a
  929. descriptive name, as explained in the <tt>gpg</tt> man page. The public key for
  930. this identity must be in the key ring of the user running <tt>gpg</tt>, which
  931. is the same as specified by <tt>BM_UPLOAD_SSH_USER</tt>. To test this
  932. run the command <tt> gpg --list-keys ID </tt> as that user, where
  933. <tt>ID</tt> is the ID as you give it to this parameter. If <tt>gpg</tt>
  934. displays exactly one key, then you are fine. Refer to the <tt>gpg</tt> man page
  935. for further details.
  936. <p>
  937. Example:
  938. <example>
  939. export BM_UPLOAD_SSH_GPG_RECIPIENT="email@address.com"
  940. export BM_UPLOAD_SSH_GPG_RECIPIENT="ECE009856"
  941. </example>
  942. <sect1 id="upload-ftp">FTP uploads
  943. <sect2 id="uploads-ftp-desc">Description
  944. <p>
  945. If security does not matter much on your lan (between the two points of the upload) you can choose to use the
  946. FTP method.
  947. One of the main pros of this method is that it can perform purging independently. You can safely use this method
  948. for uploading files to a host where you just have an FTP account.
  949. <sect2 id="BM_UPLOAD_FTP_SECURE"><tt>BM_UPLOAD_FTP_SECURE</tt>
  950. <p>
  951. <em>Type: boolean, default: false.</em>
  952. <p>
  953. If this variable is set to true, all FTP transfers will be done over SSL.
  954. <p>
  955. Example:
  956. <example>
  957. export BM_UPLOAD_FTP_SECURE="true"
  958. </example>
  959. <sect2 id="BM_UPLOAD_FTP_PASSIVE"><tt>BM_UPLOAD_FTP_PASSIVE</tt>
  960. <p>
  961. <em>Type: boolean, default: true.</em>
  962. <p>
  963. If this variable is set to true, FTP transfers will be performed in passive mode,
  964. which is mandatory in NATed/firewalled environments.
  965. <p>
  966. Example:
  967. <example>
  968. export BM_UPLOAD_FTP_PASSIVE="true"
  969. </example>
  970. <sect2 id="BM_UPLOAD_FTP_TTL"><tt>BM_UPLOAD_FTP_TTL</tt>
  971. <p>
  972. <em>Type: integer, default: $BM_ARCHIVE_TTL</em>
  973. <p>
  974. Using different <em>time to live</em> values for local and remote archives can
  975. be useful in certain situations. For instance, it's possible to install &bmngr;
  976. locally, make it build archives, upload them to a remote FTP host and then purge
  977. them locally (but not on the remote host). Doing this is possible with setting a
  978. null value to the local TTL (BM_ARCHIVE_TTL) and a non-null value to
  979. BM_UPLOAD_FTP_TTL.
  980. <p>
  981. Example:
  982. <example>
  983. # in your main conffile -- /etc/backup-manager.conf
  984. export BM_ARCHIVE_TTL="0"
  985. export BM_UPLOAD_FTP_TTL="5"
  986. export BM_POST_BACKUP_COMMAND="/usr/sbin/backup-manager --purge"
  987. # in your cron job:
  988. /usr/sbin/backup-manager
  989. /usr/sbin/backup-manager --purge
  990. (Don't put the post-command in the main conffile or you'll face an infinite loop.)
  991. </example>
  992. <sect2 id="BM_UPLOAD_FTP_USER"><tt>BM_UPLOAD_FTP_USER</tt>
  993. <p>
  994. <em>Type: string.</em>
  995. <p>
  996. Put here the FTP user to use for opening the connections.
  997. <p>
  998. Example:
  999. <example>
  1000. export BM_UPLOAD_FTP_USER="bmngr"
  1001. </example>
  1002. <sect2 id="BM_UPLOAD_FTP_PASSWORD"><tt>BM_UPLOAD_FTP_PASSWORD</tt>
  1003. <p>
  1004. <em>Type: string.</em>
  1005. <p>
  1006. Put here the password to use for authenticating the FTP session,(in plain text).
  1007. <p>
  1008. Example:
  1009. <example>
  1010. export BM_UPLOAD_FTP_PASSWORD="secret"
  1011. </example>
  1012. <sect2 id="BM_UPLOAD_FTP_HOSTS"><tt>BM_UPLOAD_FTP_HOSTS</tt>
  1013. <p>
  1014. <em>Type: space-separated list</em>
  1015. <p>
  1016. Put here the list of hosts to use for FTP-only uploads.
  1017. Note that if you put some hosts in <tt>BM_UPLOAD_HOSTS</tt>, they will be used as well.
  1018. <p>
  1019. Example:
  1020. <example>
  1021. export BM_UPLOAD_FTP_HOSTS="mirror4.lan.mysite.net"
  1022. </example>
  1023. <sect2 id="BM_UPLOAD_FTP_DESTINATION"><tt>BM_UPLOAD_FTP_DESTINATION</tt>
  1024. <p>
  1025. <em>Type: string</em>
  1026. <p>
  1027. Put here the destination for FTP-only uploads, this key overrides
  1028. <tt>BM_UPLOAD_DESTINATION</tt>.
  1029. <p>
  1030. Example:
  1031. <example>
  1032. export BM_UPLOAD_FTP_DESTINATION="/var/archives/ftp-uploads"
  1033. </example>
  1034. <sect2 id="BM_UPLOAD_FTP_PURGE"><tt>BM_UPLOAD_FTP_PURGE</tt>
  1035. <p>
  1036. <em>Type: boolean, default: <tt>true</tt></em>
  1037. <p>
  1038. You can choose to purge deprecated archives before uploading new ones.
  1039. This purge is done over FTP and uses the configuration key <tt>BM_ARCHIVE_TTL</tt> in
  1040. the same manner as the local purge behaves (the FTP purge is not recursive though).
  1041. <p>
  1042. Example:
  1043. <example>
  1044. export BM_UPLOAD_FTP_PURGE="true"
  1045. </example>
  1046. <sect1 id="upload-s3">Amazon S3 uploads
  1047. <sect2 id="uploads-s3-desc">Description
  1048. <p>
  1049. Amazon's new Simple Storage Service (S3) is an Internet "web service"
  1050. that permits you to store unlimited blocks of data on their replicated
  1051. and managed systems. See http://aws.amazon.com for more
  1052. information. Registration is free and the rates are quite reasonable.
  1053. <p>
  1054. Using the S3 upload method will permit your archives to be stored on
  1055. Amazon's S3 service. You must allocate a "bucket" to the exclusive use
  1056. of Backup Manager. Each of your created archives will be uploaded to
  1057. S3 and stored within this bucket in a key name that matches the name
  1058. of the archive.
  1059. <p>
  1060. As with the other backup methods Backup Manager does not assist you in
  1061. restoring files from archives. You must retrieve archives from S3
  1062. using other mechanisms such as the S3Shell provided as an examle
  1063. command line utility by Amazon.
  1064. <p>
  1065. Note that when using this upload method, the <tt>BM_UPLOAD_HOSTS</tt> variable is
  1066. ignored as the only valid host for S3 uploads in <tt>s3.amazon.com</tt>.
  1067. <sect2 id="BM_UPLOAD_S3_DESTINATION"><tt>BM_UPLOAD_S3_DESTINATION</tt>
  1068. <p>
  1069. <em>Type: string.</em>
  1070. <p>
  1071. This option is required for the S3 upload method. This specifies the
  1072. bucket used to store backup data. If the bucket does not exist it will
  1073. be created as a private bucket. This key overrides
  1074. <tt>BM_UPLOAD_DESTINATION</tt>. Note that Amazon requires that bucket
  1075. names be globally unique. Be creative picking one.
  1076. <p>
  1077. Example:
  1078. <example>
  1079. export BM_UPLOAD_S3_DESTINATION="my_backup_bucket"
  1080. </example>
  1081. <sect2 id="BM_UPLOAD_S3_ACCESS_KEY"><tt>BM_UPLOAD_S3_ACCESS_KEY</tt>
  1082. <p>
  1083. <em>Type: string.</em>
  1084. <p>
  1085. This option is required for the S3 upload method. After you have
  1086. registered Amazon will provide you an access key. You must use this
  1087. key to access your storage on S3.
  1088. <p>
  1089. Example:
  1090. <example>
  1091. export BM_UPLOAD_S3_ACCESS_KEY="a9sabkz0342dasv"
  1092. </example>
  1093. <sect2 id="BM_UPLOAD_S3_SECRET_KEY"><tt>BM_UPLOAD_S3_SECRET_KEY</tt>
  1094. <p>
  1095. <em>Type: string.</em>
  1096. <p>
  1097. This option is required for the S3 upload method. After you have
  1098. registered Amazon will provide you a secret key. You must use this
  1099. key to write to your storage on S3.
  1100. <p>
  1101. Example:
  1102. <example>
  1103. export BM_UPLOAD_S3_SECRET_KEY="lkj2341askj123sa"
  1104. </example>
  1105. <sect2 id="BM_UPLOAD_S3_PURGE"><tt>BM_UPLOAD_S3_PURGE</tt>
  1106. <p>
  1107. <em>Type: boolean, default: <tt>true</tt></em>
  1108. <p>
  1109. You can choose to purge deprecated archives before uploading new ones.
  1110. This purge is done over S3 and uses the configuration key <tt>BM_ARCHIVE_TTL</tt> in
  1111. the same manner as the local purge behaves (the S3 purge is not recursive though).
  1112. <p>
  1113. Example:
  1114. <example>
  1115. export BM_UPLOAD_S3_PURGE="true"
  1116. </example>
  1117. <sect2 id="BM_UPLOAD_S3_TTL"><tt>BM_UPLOAD_S3_TTL</tt>
  1118. <p>
  1119. <em>Type: integer, default: $BM_ARCHIVE_TTL</em>
  1120. <p>
  1121. Using different <em>time to live</em> values for local and remote archives can
  1122. be useful in certain situations. For instance, it's possible to install &bmngr;
  1123. locally, make it build archives, upload them to S3 and then purge them locally
  1124. (but not on the remote host). Doing this is possible with setting a null value
  1125. to the local TTL (BM_ARCHIVE_TTL) and a non-null value to BM_UPLOAD_S3_TTL.
  1126. <p>
  1127. <sect1 id="upload-rsync">RSYNC uploads
  1128. <sect2 id="upload-rsync-desc">Description
  1129. <p>
  1130. You may want to upload some parts of your file system to some remote hosts.
  1131. In these cases, archives are not needed, you just want to synchronize some
  1132. directories to remote places. This is where the RSYNC upload method is useful.
  1133. <p>
  1134. RSYNC uploads need a SSH user/key pair to behave correctly, thus there is a
  1135. dependency against the keys <tt>BM_UPLOAD_SSH_USER</tt> and <tt>BM_UPLOAD_SSH_KEY</tt>.
  1136. <sect2 id="BM_UPLOAD_RSYNC_DIRECTORIES"><tt>BM_UPLOAD_RSYNC_DIRECTORIES</tt>
  1137. <p>
  1138. <em>Type: space-separated list</em>
  1139. <p>
  1140. Put here the list of local directories you want to upload with rsync.
  1141. <p>
  1142. Example:
  1143. <example>
  1144. export BM_UPLOAD_RSYNC_DIRECTORIES="/data/photos /data/videos /data/mp3"
  1145. </example>
  1146. <sect2 id="BM_UPLOAD_RSYNC_HOSTS"><tt>BM_UPLOAD_RSYNC_HOSTS</tt>
  1147. <p>
  1148. <em>Type: space-separated list</em>
  1149. <p>
  1150. Put here the list of hosts to use for RSYNC-only uploads.
  1151. Note that if you put some hosts in <tt>BM_UPLOAD_HOSTS</tt>, they will be used as well.
  1152. <p>
  1153. Example:
  1154. <example>
  1155. export BM_UPLOAD_RSYNC_HOSTS="mirror5.lan.mysite.net"
  1156. </example>
  1157. <sect2 id="BM_UPLOAD_RSYNC_DESTINATION"><tt>BM_UPLOAD_RSYNC_DESTINATION</tt>
  1158. <p>
  1159. <em>Type: string</em>
  1160. <p>
  1161. Put here the destination for RSYNC-only uploads, this key overrides
  1162. <tt>BM_UPLOAD_DESTINATION</tt>.
  1163. <p>
  1164. Example:
  1165. <example>
  1166. export BM_UPLOAD_RSYNC_DESTINATION="/var/archives/rsync-snapshots"
  1167. </example>
  1168. <sect2 id="BM_UPLOAD_RSYNC_DUMPSYMLINKS"><tt>BM_UPLOAD_RSYNC_DUMPSYMLINKS</tt>
  1169. <p>
  1170. <em>Type: boolean, default: <tt>false</tt>.</em>
  1171. <p>
  1172. You can choose to dereference files pointed by symlinks in your RSYNC snapshots.
  1173. This feature should be used with care.
  1174. <p>
  1175. Example:
  1176. <example>
  1177. export BM_UPLOAD_RSYNC_DUMPSYMLINKS="false"
  1178. </example>
  1179. <sect id="exports">Exports
  1180. <p>
  1181. <em>
  1182. Another way of storing your archives to a safe place is to use external media.
  1183. </em>
  1184. <p>
  1185. In version &bmngr-version;, only CDs and DVDs are supported as external media, so we will discuss
  1186. in this section only the <tt>BM_BURNING</tt> features.
  1187. Other exports are expected to come in next versions though.
  1188. <sect1 id="exports-burning">Burning CDR/DVD media
  1189. <p>
  1190. In the version &bmngr-version;, &bmngr; supports four different kinds of media: CDR,
  1191. CDRW and DVD+R(W) and DVD-R(W).
  1192. <sect2 id="BM_BURNING_METHOD"><tt>BM_BURNING_METHOD</tt>
  1193. <p>
  1194. Set the key <tt>BM_BURNING_METHOD</tt> to the method corresponding to the media you want to burn:
  1195. <list>
  1196. <item>CDR
  1197. <item>CDRW
  1198. <item>DVD
  1199. <item>DVD-RW
  1200. </list>
  1201. <p>
  1202. In <em>non-interactive mode</em> (when backup-manager is not lauchned from a terminal),
  1203. any of these methods will try to put the whole archive repository in the media, if it does not
  1204. fit in the media, it will try to put only the archives built on the day, if that's not possible,
  1205. nothing will be burnt.
  1206. <p>
  1207. In <em>interactive mode</em> (when backup-manager is launched from a terminal),
  1208. the whole repository will be burnt into as many media as needed. When a medium is
  1209. satured with archives, backup-manager will pause the process asking the user to put a new
  1210. media inside.
  1211. <p>
  1212. The <tt>CDRW</tt> and <tt>DVD-RW</tt> methods will first blank the media,
  1213. so you can safely use these methods if you want to use the same medium several times.
  1214. <p>
  1215. The <tt>CDR</tt> and <tt>DVD</tt> medthods won't blank the medium first
  1216. (DVD+RW media doesn't need blanking, it's possible to re-burn data on-the-fly
  1217. over such media)..
  1218. <p>
  1219. DVD media are handled by the tool <tt>dvd+rw-tools</tt>, problems can occur in CRON environment with
  1220. <tt>dvd+rw-tools</tt> versions prior to <tt>6.1</tt>, make sure to have <tt>6.1</tt>
  1221. or later if you want to burn DVD media with Backup Manager.
  1222. <p>
  1223. As usual, you can put <tt>none</tt> in order to disable the burning process.
  1224. <p>
  1225. All those burning methods share the same configuration keys, so it's easy to
  1226. switch from a medium to another.
  1227. <sect2 id="BM_BURNING_DEVICE"><tt>BM_BURNING_DEVICE</tt>
  1228. <p>
  1229. <em>Type: string, default: <tt>/dev/cdrom</tt>.</em>
  1230. <p>
  1231. This is mandatory for using the burning feature, it's the device
  1232. to use for mounting the media. It's needed by backup manager for
  1233. performing the MD5 checks and for other needs.
  1234. <p>
  1235. Example:
  1236. <example>
  1237. export BM_BURNING_DEVICE="/dev/cdrom"
  1238. </example>
  1239. <sect2 id="BM_BURNING_DEVFORCED"><tt>BM_BURNING_DEVFORCED</tt>
  1240. <p>
  1241. <em>Type: string</em>
  1242. <p>
  1243. &bmngr; uses <tt>cdrecord</tt> for burning CDs. If when you run
  1244. <tt>cdrecord -scanbus</tt> you don't see your burning device, that means you will have to
  1245. force the device in ATA mode.
  1246. To tell &bmngr; to do so, just put here the path to your device, and a switch will be appended to the
  1247. cdrecord commandline like the following : <tt>cdrecrord ... dev=$BM_BURNING_DEVFORCED ...</tt>.
  1248. <p>
  1249. Leave this configuration key blank if you see your device with <tt>cdrecord -scanbus</tt>,
  1250. in this case, &bmngr; will use the default cdrecord device for burning CDR media.
  1251. <p>
  1252. Example:
  1253. <example>
  1254. export BM_BURNING_DEVFORCED="/dev/cdrom"
  1255. </example>
  1256. <sect2 id="BM_BURNING_ISO_FLAGS"><tt>BM_BURNING_ISO_FLAGS</tt>
  1257. <p>
  1258. <em>Type: string, default: "-R -J"</em>
  1259. <p>
  1260. Media burned with &bmngr; will be made using a Joliet disc image.
  1261. The flags defined in that variable will be appended to the mkisofs command
  1262. lines in order to specify wich media image to use.
  1263. <p>
  1264. The default value "-R -J" produces a Joliet image, if you want to make
  1265. non-Joliet disc images, you can change these flags. Refer to the manpage of
  1266. mkisofs for details about possible disc images.
  1267. <p>
  1268. Don't change that variable if you don't know what you're doing.
  1269. <p>
  1270. Example:
  1271. <example>
  1272. export BM_BURNING_ISO_FLAGS="-R -J"
  1273. </example>
  1274. <sect2 id="BM_BURNING_MAXSIZE"><tt>BM_BURNING_MAXSIZE</tt>
  1275. <p>
  1276. <em>Type: integer, default: <tt>700</tt>.</em>
  1277. <p>
  1278. This is where you define the maximum size (in megabytes)
  1279. of the media you will put in the device.
  1280. Here is the list of the common sizes:
  1281. <list>
  1282. <item>CDR/CDRW: 650, 700, 800
  1283. <item>DVD: 4700
  1284. </list>
  1285. <p>
  1286. When &bmngr; looks in the repository for burning data, it will try to put
  1287. the whole archive repository in the media. If the summarized size of the
  1288. repository does not fit in <tt>BM_BURNING_MAXSIZE</tt>, &bmngr; will then
  1289. try to put only the archives of the day.
  1290. <p>
  1291. Example for a CD burner
  1292. <example>
  1293. export BM_BURNING_METHOD="CDRW"
  1294. export BM_BURNING_MAXSIZE="700"
  1295. </example>
  1296. <p>
  1297. Example for a DVD burner:
  1298. <example>
  1299. export BM_BURNING_METHOD="DVD"
  1300. export BM_BURNING_MAXSIZE="4700"
  1301. </example>
  1302. <sect2 id="BM_BURNING_CHKMD5"><tt>BM_BURNING_CHKMD5</tt>
  1303. <p>
  1304. <em>Type: boolean, default: <tt>true</tt>.</em>
  1305. <p>
  1306. If this boolean is set to a true value, every MD5 sum will be checked when the media
  1307. is burned in order to make sure everything is ok.
  1308. <p>
  1309. Note that you can choose to perform this checkup with the command
  1310. switch <tt>--md5check</tt>.
  1311. <p>
  1312. Example:
  1313. <example>
  1314. exports BM_BURNING_CHKMD5="true"
  1315. </example>
  1316. <sect id="advanced">Advanced features
  1317. <p>
  1318. <em>A couple of advanced features are provided, they will be covered in this section.</em>
  1319. <sect1 id="BM_TEMP_DIR"><tt>BM_TEMP_DIR</tt>
  1320. <p>
  1321. <em>Type: string, default: <tt>/tmp/backup-manager</tt>.</em>
  1322. <p>
  1323. This is the temporary directory where temporary files are created by Backup Manager.
  1324. <p>
  1325. Example:
  1326. <example>
  1327. export BM_ARCHIVE_CHMOD="/tmp/backup-manager"
  1328. </example>
  1329. <sect1 id="advanced-logger">Logging to syslog
  1330. <p>
  1331. If you want to log &bmngr; actions to syslog, you can enable the internal
  1332. logger, this is done with the configuration key <tt>BM_LOGGER</tt>. You are also
  1333. able to choose which syslog facility to use thanks to the key
  1334. <tt>BM_LOGGER_FACILITY</tt>.
  1335. <sect2 id="BM_LOGGER"><tt>BM_LOGGER</tt>
  1336. <p>
  1337. <em>Type: boolean, default: <tt>true</tt>.</em>
  1338. <p>
  1339. If this boolean is set to true, &bmngr; will log everything to syslog.
  1340. <p>
  1341. Example:
  1342. <example>
  1343. exports BM_LOGGER="true"
  1344. </example>
  1345. <sect2 id="BM_LOGGER_FACILITY"><tt>BM_LOGGER_FACILITY</tt>
  1346. <p>
  1347. <em>Type: string, default: <tt>user</tt>.</em>
  1348. <p>
  1349. You can specify here a syslog facility to use, this can be useful if you like to
  1350. filter messages from &bmngr; to a special syslog file.
  1351. <p>
  1352. Example:
  1353. <example>
  1354. exports BM_LOGGER_FACILITY="cron"
  1355. </example>
  1356. <sect1 id="advanced-externals">Writing external hooks
  1357. <p>
  1358. You have the availability to write your own hooks if you want to automate some
  1359. special beaviours within the &bmngr; process. You may like to mount over NFS your
  1360. archive repository <em>before</em> the backup session and unmount it after, or
  1361. you may like to launch your own uploader script when the backup session is
  1362. finished.
  1363. <p>
  1364. In order to let you implement any solution you like, &bmngr; provides two
  1365. different hooks: the <em>pre-command</em> and <em>post-command</em> hooks.
  1366. <sect2 id="BM_PRE_BACKUP_COMMAND"><tt>BM_PRE_BACKUP_COMMAND</tt>
  1367. <p>
  1368. <em>Type: string</em>
  1369. <p>
  1370. Put here the path to a program (or a shell command) to launch before the backup
  1371. session. If the command fails (exits with non zero value, or prints the keyword
  1372. <tt>false</tt> on stdout) the backup session will stop. If the pre-command
  1373. succeeds, the process can follow.
  1374. <p>
  1375. Example with a basic shell command:
  1376. <example>
  1377. export BM_PRE_BACKUP_COMMAND="mount -t nfs mirror.lan.net:/exports/backups /var/archives"
  1378. </example>
  1379. <p>
  1380. Example with a custom script:
  1381. <example>
  1382. export BM_PRE_BACKUP_COMMAND="/usr/local/bin/backup-prepare.pl $TODAY"
  1383. </example>
  1384. <sect2 id="BM_POST_BACKUP_COMMAND"><tt>BM_POST_BACKUP_COMMAND</tt>
  1385. <p>
  1386. <em>Type: string</em>
  1387. <p>
  1388. Put here the path to a program (or a shell command) to launch after the backup
  1389. session. If the command fails (exits with non zero value, or prints the keyword
  1390. <tt>false</tt> on stdout) &bmngr; will exit with an error code (and will log to
  1391. syslog the post-command failure if the logger is enabled).
  1392. <p>
  1393. Example with a basic shell command:
  1394. <example>
  1395. export BM_POST_BACKUP_COMMAND="umount /var/archives"
  1396. </example>
  1397. <p>
  1398. Example with a custom script:
  1399. <example>
  1400. export BM_POST_BACKUP_COMMAND="/usr/local/bin/backup-cleanup.pl $TODAY"
  1401. </example>
  1402. <chapt id="using">Using &bmngr;
  1403. <p>
  1404. <em>Now that you know in details how to write your configuration files,
  1405. let's see how to use &bmngr;.</em>
  1406. <sect id="command">Command line
  1407. <sect1 id="command-desc">Restrictions
  1408. <p>
  1409. In version &bmngr-version;, &bmngr; can only be used by <tt>root</tt>,
  1410. as it has be designed as a systemwide tool.
  1411. <example>
  1412. $ backup-manager
  1413. backup-manager must be run as root.
  1414. </example>
  1415. If you want to launch it from the command line, you first have to use the <tt>root</tt>
  1416. account.
  1417. <example>
  1418. $ su
  1419. Password:
  1420. # backup-manager -h
  1421. /usr/sbin/backup-manager [options]
  1422. Output:
  1423. --help|-h : Print this short help message.
  1424. --verbose|-v : Print what happens on STDOUT.
  1425. --no-warnings : Disable warnings.
  1426. Single actions:
  1427. --upload|-u : Just upload the files of the day.
  1428. --burn|-b : Just burn the files of the day.
  1429. --md5check|-m : Just test the md5 sums.
  1430. --purge|-p : Just purge old archives.
  1431. Behaviour:
  1432. --conffile|-c file : Choose an alternate config file.
  1433. --force|-f : Force overwrite of existing archives.
  1434. Unwanted actions:
  1435. --no-upload : Disable the upload process.
  1436. --no-burn : Disable the burning process.
  1437. --no-purge : Disable the purge process.
  1438. ouranos:/home/sukria#
  1439. </example>
  1440. <p>
  1441. As you can see in the example above, using the <tt>-h</tt> switch (or <tt>--help</tt>) gives
  1442. a short help message and prints all supported command switches.
  1443. We will cover in this section each of them.
  1444. <sect1 id="command-switched">Options
  1445. <p>
  1446. The following switches can be used for altering &bmngr;'s behaviour.
  1447. <sect2 id="version"><tt>--version</tt>
  1448. <p>
  1449. Prints on stdout the &bmngr; version installed on the system and exit.
  1450. <p>
  1451. Example:
  1452. <example>
  1453. # backup-manager --version
  1454. Backup Manager 0.6
  1455. </example>
  1456. <sect2 id="verbose"><tt>--verbose</tt> or <tt>-v</tt>
  1457. <p>
  1458. Using this switch will enabled the verbose mode. All actions are reported on stdout.
  1459. <p>
  1460. Example:
  1461. <example>
  1462. # backup-manager -v
  1463. Getting lock for backup-manager 10605 with /etc/backup-manager.conf: ok
  1464. Cleaning /var/archives
  1465. Entering directory /var/archives/lost+found.
  1466. [...]
  1467. </example>
  1468. <sect2 id="no-warnings"><tt>--no-warnings</tt>
  1469. <p>
  1470. When a non-critical problem occurs (an error occured but the backup process can follow)
  1471. &bmngr; will print a warning message (and will log it if the logger is enabled).
  1472. If you don't want to see warning messages, you can append this switch on the command line.
  1473. <sect2 id="conffile"><tt>--conffile</tt> or <tt>-c</tt>
  1474. <p>
  1475. &bmngr; relies on configuration files, by default, the file <tt>/etc/backup-manager.conf</tt> is used but
  1476. you can choose to run it with a different one. This is done by using the following syntax :
  1477. <example>
  1478. # backup-manager -c &lt;FILE&gt;
  1479. </example>
  1480. <p>
  1481. Note that &bmngr; is designed to work properly when launched in parallel mode with different configuration
  1482. files, but it will refuse to run twice at the same time with the same configuration file.
  1483. You can then safely do something like that:
  1484. <example>
  1485. # backup-manager -c /etc/backup-manager/backup-nfs.conf &
  1486. # backup-manager -c /etc/backup-manager/backup-homedirs.conf &
  1487. # backup-manager -c /etc/backup-manager/backup-rsync-filer.conf
  1488. </example>
  1489. <sect2 id="force"><tt>--force</tt>
  1490. <p>
  1491. When building an archive, &bmngr; looks if the archive already exists in the repository, if so, a warning
  1492. is sent saying that the archive exists. If you want to bypass this warning and overwrite archives, use
  1493. this switch.
  1494. <sect2 id="upload"><tt>--upload</tt> or <tt>-u</tt>
  1495. <p>
  1496. If you have made a configuration file that enables the uploading system, you can ask &bmngr; to
  1497. perform the uploading session instead of the whole process with this switch.
  1498. <sect2 id="burn"><tt>--burn</tt> or <tt>-b</tt> [&lt;DATE&gt;]
  1499. <p>
  1500. If you have made a configuration file that enables the burning system, you can ask &bmngr; to
  1501. perform the burning session instead of the whole process with this switch.
  1502. <p>
  1503. You can also ask &bmngr; to burn only archives of a given date with providing a timestamp
  1504. after the <tt>--burn</tt> switch.
  1505. <p>
  1506. Example:
  1507. <p>
  1508. Burning all the archives made on March, 12nd 2006:
  1509. <example>
  1510. # backup-manager --bnurn 20060312
  1511. </example>
  1512. <sect2 id="md5check"><tt>--md5check</tt> or <tt>-m</tt>
  1513. <p>
  1514. If you have made a configuration file that enables the MD5 checks on burnt media, you can ask &bmngr; to
  1515. perform the MD5 checks instead of the whole process with this switch.
  1516. <sect2 id="purge"><tt>--purge</tt> or <tt>-p</tt>
  1517. <p>
  1518. This switch will as &bmngr; to just perform the archive repository purge:
  1519. removing any depreacted archives (according to <tt>BM_ARCHIVE_TTL</tt>.
  1520. <sect2 id="no-upload"><tt>--no-upload</tt> or <tt>-p</tt>
  1521. <p>
  1522. Use this switch if you have a configuration file that enables the uploading system and want to run
  1523. &bmngr; without it.
  1524. <sect2 id="no-burn"><tt>--no-burn</tt>
  1525. <p>
  1526. Use this switch if you have a configuration file that enables the burning system and want to run
  1527. &bmngr; without it.
  1528. <sect2 id="no-purge"><tt>--no-purge</tt> or <tt>-p</tt>
  1529. <p>
  1530. Use this switch if you want to disable the purging phase. This can be useful if you like
  1531. to implement another kind of purging system, with a post-command hook for instance.
  1532. <sect id="cron">CRON integration
  1533. <p>
  1534. There is a global idea behind &bmngr;'s design: "<em>You won't do it if you have to think about it</em>".
  1535. This is specifically true for backup concerns and it is strongly adviced to automate your
  1536. backup process with a tasks scheduler like CRON.
  1537. <p>
  1538. Setting up a &bmngr; job in cron is pretty easy, you just have to write a shell script under
  1539. the appropriate CRON sub-directory that will call backup-manager.
  1540. The best sub-directory to choose is <tt>/etc/cron.daily</tt> as &bmngr; handles daily archives.
  1541. <p>
  1542. Here is an example of a CRON script:
  1543. <example>
  1544. cat > /etc/cron.daily/backup-manager
  1545. #!/bin/sh
  1546. /usr/sbin/backup-manager
  1547. </example>
  1548. <p>
  1549. If you want to be notified by mail if a problem occurs during the backup session,
  1550. just make sure you receive mails coming from CRON. When the verbose mode is off,
  1551. only warnings and errors are printed on stdout, so you will receive a mail from
  1552. the &bmngr; CRON job only in case of unexpected effects.
  1553. <p>
  1554. On the other hand, if you like to receive daily mails from the job, even if everything
  1555. went well, just append the --verbose switch like that :
  1556. <example>
  1557. cat > /etc/cron.daily/backup-manager
  1558. #!/bin/sh
  1559. /usr/sbin/backup-manager --verbose
  1560. </example>
  1561. <!--
  1562. <chapt id="restore">Restoring Archives
  1563. <p>
  1564. You make archives for being ready to back your system up when needed. When such a time
  1565. comes, you will have to restore an archive. In the current version, Backup Manager does
  1566. not provide a way to automatically restore an archive. You'll have to do it by
  1567. hand. This is planed to be supported in next versions though.
  1568. <p>
  1569. We will cover in this chapter evry method for restoring archives. Of course the
  1570. restore method depends on the kind of archive you have to manipulate.
  1571. <sect id="restore-tarballs">Tarballs
  1572. <p>
  1573. Let's begin with the basic kind of archives, the "tarballs".
  1574. <sect1 id="restore-tar"><tt>tar</tt>, <tt>tar.gz</tt> and <tt>tar.bz2</tt> archives
  1575. <p>
  1576. All these archives are made using the <tt>tar</tt> command, restoring them will
  1577. be about to use tar with the appropriate options for uncompressing the archive.
  1578. <p>
  1579. Exemple:
  1580. <p>
  1581. We want to restore the file <tt>/etc/passwd</tt> and the directory <tt>/home/john/work/</tt>.
  1582. Every toplevel directory of our filesystem is archived:
  1583. <example>
  1584. BM_TARBALL_DIRECTORIES="/*"
  1585. BM_TARBALL_BLACKLIST="/tmp /dev /proc /sys"
  1586. </example>
  1587. <p>
  1588. We have to
  1589. <sect1 id="restore-zip"><tt>zip</tt> archives
  1590. <sect1 id="restore-dar"><tt>dar</tt> archives
  1591. <sect id="restore-incremental">Incremental tarballs
  1592. <sect id="restore-mysql">MySQL dumps
  1593. <sect id="restore-svn">SVN dumps
  1594. -->
  1595. </book>
  1596. </debiandoc>
  1597. <!-- Keep this comment at the end of the file
  1598. Local variables:
  1599. mode: sgml
  1600. sgml-omittag:t
  1601. sgml-shorttag:t
  1602. sgml-minimize-attributes:nil
  1603. sgml-always-quote-attributes:t
  1604. sgml-indent-step:2
  1605. sgml-indent-data:nil
  1606. sgml-parent-document:nil
  1607. sgml-exposed-tags:nil
  1608. sgml-declaration:nil
  1609. sgml-local-catalogs:nil
  1610. sgml-local-ecat-files:nil
  1611. End:
  1612. -->