[1] | 1 | /***************************************************************************
|
---|
[1113] | 2 | * $Id: mondostructures.h 1904 2008-04-09 23:20:42Z bruno $
|
---|
| 3 | *
|
---|
[1] | 4 | * @file
|
---|
| 5 | * The header file defining all of Mondo's structures.
|
---|
| 6 | */
|
---|
| 7 |
|
---|
| 8 |
|
---|
| 9 | /**
|
---|
| 10 | * Structure indicating one entry in the mountlist.
|
---|
| 11 | * There is one mountlist_line for each device we're keeping track of in the mountlist.
|
---|
| 12 | */
|
---|
[128] | 13 | struct mountlist_line {
|
---|
[1] | 14 | /**
|
---|
| 15 | * The name of the device (/dev entry) for this mountlist line. Guaranteed to be unique.
|
---|
| 16 | */
|
---|
[128] | 17 | char device[64];
|
---|
[1] | 18 |
|
---|
| 19 | /**
|
---|
| 20 | * The mountpoint for this mountlist line. Should be unique.
|
---|
| 21 | * This can be "raid", for a RAID subdisk, or "lvm", for an LVM PV.
|
---|
| 22 | */
|
---|
[128] | 23 | char mountpoint[256];
|
---|
[1] | 24 |
|
---|
| 25 | /**
|
---|
| 26 | * The filesystem type of this entry. Examples: ext2, ext3, reiserfs, xfs, swap.
|
---|
| 27 | * Also, this can be "raid", for a RAID subdisk, or "lvm", for an LVM PV.
|
---|
| 28 | */
|
---|
[128] | 29 | char format[64];
|
---|
[1] | 30 |
|
---|
| 31 | /**
|
---|
| 32 | * The size in kilobytes of this device. 0 or -1 indicates LVM.
|
---|
| 33 | */
|
---|
[128] | 34 | long long size;
|
---|
[1] | 35 |
|
---|
| 36 | /**
|
---|
[1904] | 37 | * For ext2 and ext3, this is the filesystem label or uuid (if there is one). If not, this should be "".
|
---|
[1] | 38 | */
|
---|
[128] | 39 | char label[256];
|
---|
[1297] | 40 |
|
---|
[1] | 41 | };
|
---|
| 42 |
|
---|
| 43 | /**
|
---|
| 44 | * The mountlist structure.
|
---|
| 45 | * This is used to keep track of a list of all the devices/partitions/formats/sizes/labels in the
|
---|
| 46 | * system, so we can recreate them in a nuke restore.
|
---|
| 47 | */
|
---|
[128] | 48 | struct mountlist_itself {
|
---|
[1] | 49 | /**
|
---|
| 50 | * Number of entries in the mountlist.
|
---|
| 51 | */
|
---|
[128] | 52 | int entries;
|
---|
[1] | 53 |
|
---|
| 54 | /**
|
---|
| 55 | * The list of entries, all @p entries of them.
|
---|
| 56 | */
|
---|
[128] | 57 | struct mountlist_line el[MAX_TAPECATALOG_ENTRIES];
|
---|
[1] | 58 | };
|
---|
| 59 |
|
---|
| 60 | /**
|
---|
| 61 | * A structure which holds references to elements of the mountlist.
|
---|
| 62 | * This is used in resize_drive_proportionately_to_fit_new_drives() to
|
---|
| 63 | * ensure accurate resizing.
|
---|
| 64 | */
|
---|
[128] | 65 | struct mountlist_reference {
|
---|
[1] | 66 | /**
|
---|
| 67 | * The number of entries in the list of mountlist references.
|
---|
| 68 | */
|
---|
[128] | 69 | int entries;
|
---|
[1] | 70 |
|
---|
| 71 | /**
|
---|
| 72 | * The array of mountlist_line, allocated on demand.
|
---|
| 73 | */
|
---|
[128] | 74 | struct mountlist_line **el;
|
---|
[1] | 75 | };
|
---|
| 76 |
|
---|
| 77 | /**
|
---|
| 78 | * A line in @p additional_raid_variables.
|
---|
| 79 | */
|
---|
[128] | 80 | struct raid_var_line {
|
---|
[1] | 81 | /**
|
---|
| 82 | * The label for this RAID variable.
|
---|
| 83 | */
|
---|
[128] | 84 | char label[64];
|
---|
[1] | 85 |
|
---|
| 86 | /**
|
---|
| 87 | * The value for this RAID variable.
|
---|
| 88 | */
|
---|
[128] | 89 | char value[64];
|
---|
[1] | 90 | };
|
---|
| 91 |
|
---|
| 92 | /**
|
---|
| 93 | * The additional RAID variables structure.
|
---|
| 94 | * This is used to store a list of additional variables to be put in the raidtab,
|
---|
| 95 | * to allow users to use (new) features of RAID which Mondo doesn't (yet) support directly.
|
---|
| 96 | * Each @p raid_device_record has one.
|
---|
| 97 | */
|
---|
[128] | 98 | struct additional_raid_variables {
|
---|
[1] | 99 | /**
|
---|
| 100 | * The number of entries in the list.
|
---|
| 101 | */
|
---|
[128] | 102 | int entries;
|
---|
[1] | 103 |
|
---|
| 104 | /**
|
---|
| 105 | * The list of entries, all @p entries of them.
|
---|
| 106 | */
|
---|
[128] | 107 | struct raid_var_line el[MAXIMUM_ADDITIONAL_RAID_VARS];
|
---|
[1] | 108 | };
|
---|
| 109 |
|
---|
| 110 | /**
|
---|
| 111 | * One disk in a @p list_of_disks.
|
---|
| 112 | */
|
---|
[128] | 113 | struct s_disk {
|
---|
[1] | 114 | #ifdef __FreeBSD__
|
---|
[128] | 115 | /**
|
---|
[1] | 116 | * The name of this disk. If blank it will eventually get filled in automatically.
|
---|
| 117 | */
|
---|
[128] | 118 | char name[64];
|
---|
[1] | 119 | #endif
|
---|
| 120 | /**
|
---|
| 121 | * The device this entry describes.
|
---|
| 122 | */
|
---|
[128] | 123 | char device[64];
|
---|
[1] | 124 |
|
---|
| 125 | /**
|
---|
| 126 | * Index number of this entry in the whole disklist.
|
---|
| 127 | */
|
---|
[128] | 128 | int index;
|
---|
[558] | 129 |
|
---|
| 130 | /**
|
---|
| 131 | * Type of disk.
|
---|
| 132 | */
|
---|
| 133 | char type; // ' ' = data (default), S = spare, F = faulty
|
---|
| 134 |
|
---|
[1] | 135 | };
|
---|
| 136 |
|
---|
| 137 | /**
|
---|
| 138 | * A list of @p s_disk. Every @p raid_device_record has four.
|
---|
| 139 | */
|
---|
[128] | 140 | struct list_of_disks {
|
---|
[1] | 141 | /**
|
---|
| 142 | * The number of entries in the disklist.
|
---|
| 143 | */
|
---|
[128] | 144 | int entries;
|
---|
[1] | 145 |
|
---|
| 146 | /**
|
---|
| 147 | * The entries themselves, all @p entries of them.
|
---|
| 148 | */
|
---|
[128] | 149 | struct s_disk el[MAXIMUM_DISKS_PER_RAID_DEV];
|
---|
[1] | 150 | };
|
---|
| 151 |
|
---|
| 152 | /**
|
---|
| 153 | * A type of media we're backing up to.
|
---|
| 154 | */
|
---|
[128] | 155 | typedef enum { none = 0, ///< No type has been set yet.
|
---|
| 156 | iso, ///< Back up to ISO images.
|
---|
| 157 | cdr, ///< Back up to recordable CDs (do not erase them).
|
---|
| 158 | cdrw, ///< Back up to CD-RWs and blank them first.
|
---|
| 159 | dvd, ///< Back up to DVD+R[W] or DVD-R[W] disks.
|
---|
| 160 | cdstream, ///< Back up to recordable CDs but treat them like a tape streamer.
|
---|
| 161 | nfs, ///< Back up to an NFS mount on the local subnet.
|
---|
| 162 | tape, ///< Back up to tapes.
|
---|
[1063] | 163 | usb, ///< Back up to USB devices.
|
---|
[128] | 164 | udev ///< Back up to another unsupported device; just send a stream of bytes.
|
---|
| 165 | } t_bkptype;
|
---|
[1] | 166 |
|
---|
[1769] | 167 | /*
|
---|
| 168 | * Type of compression algorithm we're using
|
---|
| 169 | */
|
---|
| 170 | typedef enum {
|
---|
| 171 | none = 0, //< No compression
|
---|
| 172 | gzip, //< Compression with gzip
|
---|
| 173 | bzip2, //< Compression with bzip2
|
---|
| 174 | lzo, //< Compression with lzo
|
---|
| 175 | lzma //< Compression with lzma
|
---|
| 176 | } t_mr_comp;
|
---|
| 177 |
|
---|
[1] | 178 | /**
|
---|
| 179 | * A type of file in the catalog of recent archives.
|
---|
| 180 | */
|
---|
[128] | 181 | typedef enum { other, ///< Some other kind of file.
|
---|
| 182 | fileset, ///< An afioball (fileset), optionally compressed.
|
---|
| 183 | biggieslice ///< A slice of a biggiefile, optionally compressed.
|
---|
| 184 | } t_archtype;
|
---|
[1] | 185 |
|
---|
| 186 |
|
---|
| 187 | #ifdef __FreeBSD__
|
---|
| 188 |
|
---|
[128] | 189 | struct vinum_subdisk {
|
---|
| 190 | char which_device[64];
|
---|
| 191 | };
|
---|
[1] | 192 |
|
---|
[128] | 193 | struct vinum_plex {
|
---|
| 194 | int raidlevel;
|
---|
| 195 | int stripesize;
|
---|
| 196 | int subdisks;
|
---|
| 197 | struct vinum_subdisk sd[MAXIMUM_RAID_DEVS];
|
---|
| 198 | };
|
---|
| 199 |
|
---|
| 200 | struct vinum_volume {
|
---|
| 201 | char volname[64];
|
---|
| 202 | int plexes;
|
---|
| 203 | struct vinum_plex plex[9];
|
---|
| 204 | };
|
---|
| 205 |
|
---|
| 206 | struct raidlist_itself {
|
---|
| 207 | int entries;
|
---|
| 208 | struct list_of_disks spares;
|
---|
| 209 | struct list_of_disks disks;
|
---|
| 210 | struct vinum_volume el[MAXIMUM_RAID_DEVS];
|
---|
| 211 | };
|
---|
| 212 |
|
---|
[1] | 213 | #else
|
---|
| 214 |
|
---|
[128] | 215 | /**
|
---|
[1] | 216 | * A RAID device in the raidlist.
|
---|
| 217 | */
|
---|
[128] | 218 | struct raid_device_record {
|
---|
[1] | 219 | /**
|
---|
| 220 | * The name of the RAID device (e.g. /dev/md0).
|
---|
| 221 | */
|
---|
[128] | 222 | char raid_device[64];
|
---|
[1] | 223 |
|
---|
| 224 | /**
|
---|
| 225 | * The RAID level (-1 to 5) we're using.
|
---|
| 226 | */
|
---|
[128] | 227 | int raid_level;
|
---|
[1] | 228 |
|
---|
| 229 | /**
|
---|
| 230 | * Whether the disk has a persistent superblock.
|
---|
| 231 | */
|
---|
[128] | 232 | int persistent_superblock;
|
---|
[1] | 233 |
|
---|
| 234 | /**
|
---|
| 235 | * The chunk size of this RAID device.
|
---|
| 236 | */
|
---|
[128] | 237 | int chunk_size;
|
---|
[558] | 238 |
|
---|
| 239 | /**
|
---|
| 240 | * The parity algorithm of this RAID device. (RAID5 only)
|
---|
| 241 | */
|
---|
| 242 | int parity; // 0=left-asymmetric, 1=right-asymmetric, 2=left-symmetric, 3=right-symmetric
|
---|
[1] | 243 |
|
---|
| 244 | /**
|
---|
| 245 | * A list of the disks to use for storing data.
|
---|
| 246 | */
|
---|
[128] | 247 | struct list_of_disks data_disks;
|
---|
[1] | 248 |
|
---|
| 249 | /**
|
---|
| 250 | * A list of the disks to use as "hot spares" in case one dies.
|
---|
| 251 | */
|
---|
[128] | 252 | struct list_of_disks spare_disks;
|
---|
[1] | 253 |
|
---|
| 254 | /**
|
---|
| 255 | * A list of the disks to use for storing parity information.
|
---|
| 256 | */
|
---|
[128] | 257 | struct list_of_disks parity_disks;
|
---|
[1] | 258 |
|
---|
| 259 | /**
|
---|
| 260 | * A list of the disks in this RAID device that have failed\. Rare.
|
---|
| 261 | */
|
---|
[128] | 262 | struct list_of_disks failed_disks;
|
---|
[1] | 263 |
|
---|
| 264 | /**
|
---|
| 265 | * The additional RAID variables for this device.
|
---|
| 266 | */
|
---|
[128] | 267 | struct additional_raid_variables additional_vars;
|
---|
[558] | 268 |
|
---|
| 269 | /**
|
---|
| 270 | * Resync progress for this device.
|
---|
| 271 | */
|
---|
| 272 | int progress;
|
---|
[128] | 273 | };
|
---|
[1] | 274 |
|
---|
[128] | 275 | /**
|
---|
[1] | 276 | * The list of RAID devices.
|
---|
| 277 | * This is intended to be used along with the mountlist, and it can be
|
---|
| 278 | * directly loaded from/saved to raidtab format.
|
---|
| 279 | */
|
---|
[128] | 280 | struct raidlist_itself {
|
---|
[1] | 281 | /**
|
---|
| 282 | * The number of entries in the list.
|
---|
| 283 | */
|
---|
[128] | 284 | int entries;
|
---|
[1] | 285 |
|
---|
| 286 | /**
|
---|
| 287 | * The RAID devices in the raidlist, all @p entries of them.
|
---|
| 288 | */
|
---|
[128] | 289 | struct raid_device_record el[MAXIMUM_RAID_DEVS];
|
---|
| 290 | };
|
---|
[1] | 291 |
|
---|
| 292 | #endif
|
---|
| 293 |
|
---|
| 294 | /**
|
---|
| 295 | * The backup information structure.
|
---|
| 296 | *
|
---|
| 297 | * This is the central structure to all the activity going on inside Mondo.
|
---|
| 298 | * It is passed to almost every function that is not just a helper, even those
|
---|
| 299 | * which only use one variable of it, because it is useful keeping all the information
|
---|
| 300 | * together in one place. The usage of particular fields in the bkpinfo is marked in
|
---|
| 301 | * function documentation, but it is best to fill out as many fields as apply, because
|
---|
| 302 | * that function may in turn pass the bkpinfo to other functions which use other fields.
|
---|
| 303 | *
|
---|
| 304 | * To fill out the bkpinfo first call reset_bkpinfo() and pre_param_configuration(). Then set
|
---|
| 305 | * the backup-specific parameters (see mondo/mondoarchive/mondo-cli.c-\>process_switches for
|
---|
| 306 | * an example). After that, you should call post_param_configuration() to set some final
|
---|
| 307 | * parameters based on those you have already set. Failure to do the last step will result in
|
---|
| 308 | * extremely strange and hard-to-track errors in chop_filelist(), since optimal_set_size is 0.
|
---|
| 309 | */
|
---|
[128] | 310 | struct s_bkpinfo {
|
---|
[1] | 311 | /**
|
---|
| 312 | * The device we're backing up to.
|
---|
| 313 | * If backup_media_type is @b cdr, @b cdrw, or @b cdstream, this should be the SCSI node (e.g. 0,1,0).
|
---|
[1063] | 314 | * If backup_media_type is @b dvd, @b tape, @b usb or @b udev, this should be a /dev entry.
|
---|
[1] | 315 | * If backup_media_type is anything else, this should be blank.
|
---|
| 316 | */
|
---|
[1594] | 317 | char *media_device;
|
---|
[1] | 318 |
|
---|
[1594] | 319 | /* SCSI node (a la 0,0,0) or NULL if we use the media_device */
|
---|
| 320 | char *iso_burning_dev;
|
---|
| 321 |
|
---|
[1] | 322 | /**
|
---|
[1365] | 323 | *
|
---|
| 324 | * The size of the media in our backup set, in MB.
|
---|
[1] | 325 | * If the size should be autodetected, make it -1 (preferable) or 0.
|
---|
[1365] | 326 | *
|
---|
[1] | 327 | */
|
---|
[1365] | 328 | long media_size;
|
---|
[1] | 329 |
|
---|
| 330 | /**
|
---|
| 331 | * The boot loader that is installed. Available choices are:
|
---|
| 332 | * - 'G' for GRUB
|
---|
| 333 | * - 'L' for LILO
|
---|
| 334 | * - 'E' for ELILO
|
---|
| 335 | * - (FreeBSD only) 'B' for boot0
|
---|
| 336 | * - (FreeBSD only) 'D' for dangerously dedicated
|
---|
| 337 | * - 'R' for Raw
|
---|
| 338 | * - 'U' for Unknown or None
|
---|
| 339 | *
|
---|
| 340 | * The function which_boot_loader() can help you set this.
|
---|
| 341 | */
|
---|
[128] | 342 | char boot_loader;
|
---|
[1] | 343 |
|
---|
| 344 | /**
|
---|
| 345 | * The boot device on which @p boot_loader is installed.
|
---|
| 346 | * This is a bit difficult to autodetect; you may want
|
---|
| 347 | * to take truncate_to_drive_name() of where_is_root_mounted().
|
---|
| 348 | */
|
---|
[128] | 349 | char boot_device[MAX_STR_LEN / 4];
|
---|
[1] | 350 |
|
---|
| 351 | /**
|
---|
| 352 | * The compression program to use. Currently supported
|
---|
[1769] | 353 | * choices are lzop, bzip2, and gzip. This is ignored if
|
---|
[1] | 354 | * compression_level is 0.
|
---|
| 355 | */
|
---|
[1769] | 356 | char *compression_tool;
|
---|
[1] | 357 |
|
---|
| 358 | /**
|
---|
| 359 | * The extension your compression program uses. lzop uses lzo, bzip uses
|
---|
| 360 | * bz2, gzip uses gz, etc. Do not include the dot.
|
---|
| 361 | */
|
---|
[1769] | 362 | char *compression_suffix;
|
---|
[1] | 363 |
|
---|
| 364 | /**
|
---|
[1769] | 365 | * The compression level (1-9) to use. 0 disables compression.
|
---|
| 366 | */
|
---|
| 367 | int compression_level;
|
---|
| 368 |
|
---|
| 369 | /**
|
---|
| 370 | * The type of compression
|
---|
| 371 | */
|
---|
| 372 | t_mr_comp compression_type;
|
---|
| 373 |
|
---|
| 374 | /**
|
---|
[1] | 375 | * Devices to back up as biggiefiles.
|
---|
| 376 | *
|
---|
| 377 | * This is useful for backing up NTFS partitions.
|
---|
[296] | 378 | * @c ntfsclone is used to back up only the used sectors, so the space tradeoff is not bad.
|
---|
[1] | 379 | * However, several caveats apply to such a partition:
|
---|
| 380 | * - It must not be mounted during the backup
|
---|
[296] | 381 | * - It must be in a format that ntfsclone knows how to handle, i.e. NTFS
|
---|
[1] | 382 | * - It cannot be verified during the verify or compare phase
|
---|
| 383 | * - It may not be resized or selectively restored at restore-time (all or nothing)
|
---|
| 384 | *
|
---|
| 385 | * This is a useful feature, but use at your own risk.
|
---|
| 386 | */
|
---|
[128] | 387 | char image_devs[MAX_STR_LEN / 4];
|
---|
[1] | 388 |
|
---|
| 389 | /**
|
---|
| 390 | * A filename containing a list of extensions, one per line, to not
|
---|
| 391 | * compress. If this is set to "", afio will still exclude a set of well-known
|
---|
| 392 | * compressed files from compression, but biggiefiles that are compressed
|
---|
| 393 | * will be recompressed again.
|
---|
| 394 | */
|
---|
[128] | 395 | char do_not_compress_these[MAX_STR_LEN / 2];
|
---|
[1] | 396 |
|
---|
| 397 | /**
|
---|
| 398 | * If TRUE, then we should verify a backup.
|
---|
| 399 | */
|
---|
[128] | 400 | bool verify_data;
|
---|
[1] | 401 |
|
---|
| 402 | /**
|
---|
| 403 | * If TRUE, then we should back up some data.
|
---|
| 404 | */
|
---|
[128] | 405 | bool backup_data;
|
---|
[1] | 406 |
|
---|
| 407 | /**
|
---|
| 408 | * If TRUE, then we should restore some data.
|
---|
| 409 | */
|
---|
[128] | 410 | bool restore_data;
|
---|
[1] | 411 |
|
---|
[128] | 412 |
|
---|
[1] | 413 | /**
|
---|
| 414 | * If TRUE, then we should backup/restore using star, not afio
|
---|
| 415 | */
|
---|
[128] | 416 | bool use_star;
|
---|
[1] | 417 |
|
---|
[128] | 418 |
|
---|
[1] | 419 | /**
|
---|
| 420 | * Size of internal block reads/writes
|
---|
| 421 | */
|
---|
[128] | 422 | long internal_tape_block_size;
|
---|
| 423 |
|
---|
[1] | 424 | /**
|
---|
| 425 | * If TRUE, we're making a CD that will autonuke without confirmation when booted.
|
---|
| 426 | */
|
---|
[128] | 427 | bool disaster_recovery;
|
---|
[1] | 428 |
|
---|
| 429 | /**
|
---|
| 430 | * The directory we're backing up to.
|
---|
| 431 | * If backup_media_type is @b iso, then this is that directory.
|
---|
| 432 | * If backup_media_type is anything else, this is ignored.
|
---|
| 433 | */
|
---|
[128] | 434 | char isodir[MAX_STR_LEN / 4];
|
---|
[1] | 435 |
|
---|
[20] | 436 | /**
|
---|
| 437 | * The prefix to put in front of media number
|
---|
| 438 | * If backup_media_type is @b iso, then this is the prefix for the filename
|
---|
| 439 | * If backup_media_type is anything else, this is ignored.
|
---|
| 440 | */
|
---|
[1628] | 441 | char *prefix;
|
---|
[20] | 442 |
|
---|
[1] | 443 | /**
|
---|
| 444 | * The scratch directory to use.
|
---|
| 445 | * This is the "stage" that the CD image is made directly from.
|
---|
| 446 | * As such, it needs to be at least as large as the largest CD/DVD/ISO.
|
---|
| 447 | */
|
---|
[128] | 448 | char scratchdir[MAX_STR_LEN / 4];
|
---|
[1] | 449 |
|
---|
| 450 | /**
|
---|
| 451 | * The temp directory to use.
|
---|
| 452 | * This is where filesets are stored by the archival threads before
|
---|
| 453 | * the main thread moves them to the scratchdir. You don't need a lot
|
---|
| 454 | * of space here.
|
---|
| 455 | */
|
---|
[128] | 456 | char tmpdir[MAX_STR_LEN / 4];
|
---|
[1] | 457 |
|
---|
| 458 | /**
|
---|
| 459 | * The optimal size for each fileset. This is set automatically in
|
---|
| 460 | * post_param_configuration() based on your @p backup_media_type; you
|
---|
| 461 | * needn't set it yourself.
|
---|
| 462 | */
|
---|
[128] | 463 | long optimal_set_size;
|
---|
[1] | 464 |
|
---|
| 465 | /**
|
---|
| 466 | * The type of media we're backing up to.
|
---|
| 467 | */
|
---|
[128] | 468 | t_bkptype backup_media_type;
|
---|
[1] | 469 | // bool blank_dvd_first;
|
---|
| 470 |
|
---|
| 471 | /**
|
---|
[1113] | 472 | * The string corresponding to the media type
|
---|
| 473 | */
|
---|
| 474 | char backup_media_string[64];
|
---|
| 475 |
|
---|
| 476 | /**
|
---|
[1] | 477 | * Whether we should use a premade filelist or generate our own.
|
---|
| 478 | * If TRUE, then we generate our own filelist from the directories in @p include_paths.
|
---|
| 479 | * If FALSE, then we use the filelist whose name is specified in @p include_paths.
|
---|
| 480 | */
|
---|
[128] | 481 | bool make_filelist;
|
---|
[1] | 482 |
|
---|
| 483 | /**
|
---|
| 484 | * Directories to back up, or (if !make_filelist) the filelist to use.
|
---|
| 485 | * In the former case, multiple directories should be separated by spaces.
|
---|
| 486 | * If you do nothing, "/" will be used.
|
---|
| 487 | */
|
---|
[543] | 488 | char include_paths[MAX_STR_LEN*4];
|
---|
[1] | 489 |
|
---|
| 490 | /**
|
---|
| 491 | * Directories to NOT back up. Ignored if make_filelist == FALSE.
|
---|
| 492 | * Multiple directories should be separated by spaces. /tmp, /proc,
|
---|
| 493 | * the scratchdir, and the tempdir are automatically excluded.
|
---|
| 494 | */
|
---|
[1817] | 495 | char *exclude_paths;
|
---|
[1] | 496 |
|
---|
| 497 | /**
|
---|
| 498 | * The path to restore files relative to during a restore.
|
---|
| 499 | * This is useful if you want to extract the files (to test, for example)
|
---|
| 500 | * without overwriting the old ones. Ignored during a backup.
|
---|
| 501 | */
|
---|
[128] | 502 | char restore_path[MAX_STR_LEN];
|
---|
[1] | 503 |
|
---|
| 504 | /**
|
---|
| 505 | * A command to call BEFORE making an ISO image.
|
---|
| 506 | */
|
---|
[128] | 507 | char call_before_iso[MAX_STR_LEN];
|
---|
[1] | 508 |
|
---|
| 509 | /**
|
---|
| 510 | * A command to call to make an ISO image.
|
---|
| 511 | */
|
---|
[128] | 512 | char call_make_iso[MAX_STR_LEN];
|
---|
[1] | 513 |
|
---|
| 514 | /**
|
---|
| 515 | * A command to call AFTER making an ISO image.
|
---|
| 516 | */
|
---|
[128] | 517 | char call_after_iso[MAX_STR_LEN];
|
---|
[1] | 518 |
|
---|
| 519 | /**
|
---|
| 520 | * Path to the user's kernel, or "FAILSAFE" or "SUCKS" to use the kernel
|
---|
| 521 | * included with Mindi.
|
---|
| 522 | */
|
---|
[1669] | 523 | char *kernel_path;
|
---|
[1] | 524 |
|
---|
| 525 | /**
|
---|
| 526 | * The NFS mount to back up to/restore from.
|
---|
| 527 | * If backup_media_type is not @b nfs, this is ignored.
|
---|
| 528 | * It must contain a colon, and the server's address should be in dotted-decimal IP
|
---|
| 529 | * address form. (Domain names will be resolved in post_param_configuration().)
|
---|
| 530 | */
|
---|
[128] | 531 | char nfs_mount[MAX_STR_LEN];
|
---|
[1] | 532 |
|
---|
| 533 | /**
|
---|
| 534 | * The directory, relative to the root of @p nfs_mount, to put
|
---|
| 535 | * the backups in.
|
---|
| 536 | */
|
---|
[128] | 537 | char nfs_remote_dir[MAX_STR_LEN];
|
---|
[1] | 538 |
|
---|
| 539 | /**
|
---|
| 540 | * A tarball containing a program called "usr/bin/post-nuke" that will be run
|
---|
| 541 | * after nuking the system. If "", do not use a post-nuke tarball.
|
---|
| 542 | */
|
---|
[128] | 543 | char postnuke_tarball[MAX_STR_LEN];
|
---|
[1] | 544 |
|
---|
| 545 | /**
|
---|
| 546 | * If TRUE, then pass cdrecord the argument "blank=fast" to wipe the CDs before
|
---|
| 547 | * writing to them. This has no effect for DVDs.
|
---|
| 548 | */
|
---|
[128] | 549 | bool wipe_media_first;
|
---|
[1] | 550 |
|
---|
| 551 | /**
|
---|
[1639] | 552 | * The differential level of this backup. Currently only FALSE (full backup) and TRUE
|
---|
[1] | 553 | * (files changed since last full backup) are supported.
|
---|
| 554 | */
|
---|
[1639] | 555 | bool differential;
|
---|
[1] | 556 |
|
---|
| 557 | /**
|
---|
| 558 | * If TRUE, then don't eject media when backing up or restoring.
|
---|
| 559 | */
|
---|
[128] | 560 | bool please_dont_eject;
|
---|
[1] | 561 |
|
---|
| 562 | /**
|
---|
| 563 | * The speed of the CD-R[W] drive.
|
---|
| 564 | */
|
---|
[1594] | 565 | int writer_speed;
|
---|
[1] | 566 |
|
---|
| 567 | /**
|
---|
| 568 | * If TRUE, then cdrecord will be passed some flags to help compensate for PCs
|
---|
| 569 | * with eccentric CD-ROM drives. If it has BurnProof technology, or is in a laptop,
|
---|
| 570 | * it probably falls into this category.
|
---|
| 571 | */
|
---|
[1609] | 572 | bool manual_tray;
|
---|
[1] | 573 |
|
---|
| 574 | /**
|
---|
| 575 | * If TRUE, do not make the first CD bootable. This is dangerous but it saves a minute
|
---|
| 576 | * or so. It is useful in testing. Use with care.
|
---|
| 577 | */
|
---|
[128] | 578 | bool nonbootable_backup;
|
---|
[1] | 579 |
|
---|
| 580 | /**
|
---|
| 581 | * If TRUE, make the bootable CD use LILO/ELILO. If FALSE, use isolinux (the default).
|
---|
| 582 | */
|
---|
[128] | 583 | bool make_cd_use_lilo;
|
---|
[1] | 584 | };
|
---|
| 585 |
|
---|
| 586 |
|
---|
| 587 |
|
---|
| 588 | /**
|
---|
| 589 | * A node in a directory structure.
|
---|
| 590 | * Its internals are managed by load_filelist() et al; you only need to keep track of the top node.
|
---|
| 591 | * @bug My understanding of this structure is horrendously incomplete. Could you please fill in the details?
|
---|
| 592 | */
|
---|
[128] | 593 | struct s_node {
|
---|
[1] | 594 | /**
|
---|
| 595 | * The character this node contains.
|
---|
| 596 | */
|
---|
[128] | 597 | char ch;
|
---|
[1] | 598 |
|
---|
| 599 | /**
|
---|
| 600 | * The node to the right of this one.
|
---|
| 601 | */
|
---|
[128] | 602 | struct s_node *right;
|
---|
[1] | 603 |
|
---|
| 604 | /**
|
---|
| 605 | * The node below this one.
|
---|
| 606 | */
|
---|
[128] | 607 | struct s_node *down;
|
---|
[1] | 608 |
|
---|
| 609 | /**
|
---|
| 610 | * If TRUE, then this node is selected (for restore, for example).
|
---|
| 611 | */
|
---|
[128] | 612 | bool selected;
|
---|
[1] | 613 |
|
---|
| 614 | /**
|
---|
| 615 | * If TRUE, then we want to see the directories below this one.
|
---|
| 616 | */
|
---|
[128] | 617 | bool expanded;
|
---|
[1] | 618 | };
|
---|
| 619 |
|
---|
| 620 |
|
---|
| 621 | /**
|
---|
| 622 | * Information about one file.
|
---|
| 623 | * This is used as the "zeroth slice" of a biggiefile to be able to recreate
|
---|
| 624 | * its name, mode, owner, group, mtime, atime, and to be able to verify it in Compare Mode.
|
---|
| 625 | */
|
---|
| 626 | struct s_filename_and_lstat_info {
|
---|
[128] | 627 | /**
|
---|
[1] | 628 | * The filename of the file this structure is describing.
|
---|
| 629 | */
|
---|
| 630 | char filename[MAX_STR_LEN];
|
---|
| 631 |
|
---|
[128] | 632 | /**
|
---|
[1] | 633 | * The MD5 checksum (32 hex digits) of this file.
|
---|
| 634 | */
|
---|
| 635 | char checksum[64];
|
---|
| 636 |
|
---|
[128] | 637 | /**
|
---|
[1] | 638 | * Unused; kept for backwards compatibility.
|
---|
| 639 | */
|
---|
| 640 | char for_backward_compatibility;
|
---|
| 641 |
|
---|
[128] | 642 | /**
|
---|
[1] | 643 | * The stat buffer for this file.
|
---|
| 644 | * Generated with a call to <tt>lstat(&(struc->properties))</tt> where @p struc
|
---|
| 645 | * is the @p s_filename_and_lstat_info.
|
---|
| 646 | */
|
---|
| 647 | struct stat properties;
|
---|
[296] | 648 | bool use_ntfsprog;
|
---|
[1] | 649 | };
|
---|
| 650 |
|
---|
| 651 |
|
---|
| 652 | /**
|
---|
| 653 | * A file with associated severity if it differed in a verify or compare.
|
---|
| 654 | */
|
---|
| 655 | struct s_filelist_entry {
|
---|
[128] | 656 | /**
|
---|
[1] | 657 | * The name of the file.
|
---|
| 658 | */
|
---|
| 659 | char filename[MAX_STR_LEN];
|
---|
[128] | 660 | /**
|
---|
[1] | 661 | * The severity if the file has changed between the backup and live filesystem.
|
---|
| 662 | * This is on a scale from 1 to 3, 3 being the most important. File patterns which cause
|
---|
| 663 | * a severity of 1 are:
|
---|
| 664 | * - /etc/adjtime
|
---|
| 665 | * - /etc/mtab
|
---|
| 666 | * - /var/lib/slocate
|
---|
| 667 | * - /var/lock
|
---|
| 668 | * - /var/log
|
---|
| 669 | * - /var/spool (except /var/spool/mail)
|
---|
| 670 | * - /var/run
|
---|
| 671 | * - *~
|
---|
| 672 | * - *.log
|
---|
| 673 | * - *cache*
|
---|
| 674 | * - other temporary or unimportant files
|
---|
| 675 | *
|
---|
| 676 | * File patterns which cause a severity of 2 are:
|
---|
| 677 | * - /var (except /var/lock, /var/log, /var/run, /var/spool)
|
---|
| 678 | * - /home
|
---|
| 679 | * - /root/.*
|
---|
| 680 | * - /var/lib (except /var/lib/slocate, /var/lib/rpm)
|
---|
| 681 | * - /var/spool/mail
|
---|
| 682 | *
|
---|
| 683 | * File patterns which cause a severity of 3 are:
|
---|
| 684 | * - /etc (except /etc/adjtime, /etc/mtab)
|
---|
| 685 | * - /root (except /root/.*)
|
---|
| 686 | * - /usr
|
---|
| 687 | * - /var/lib/rpm
|
---|
| 688 | * - Anything else not matched explicitly
|
---|
| 689 | *
|
---|
| 690 | * @see severity_of_difference
|
---|
| 691 | */
|
---|
[128] | 692 | int severity;
|
---|
[1] | 693 | };
|
---|
| 694 |
|
---|
| 695 |
|
---|
| 696 | /**
|
---|
| 697 | * A list of @c s_filelist_entry.
|
---|
| 698 | */
|
---|
| 699 | struct s_filelist {
|
---|
[128] | 700 | /**
|
---|
[1] | 701 | * The number of entries in the list.
|
---|
| 702 | */
|
---|
[128] | 703 | int entries;
|
---|
[1] | 704 |
|
---|
[128] | 705 | /**
|
---|
[1] | 706 | * The entries themselves, all @p entries of them.
|
---|
| 707 | */
|
---|
| 708 | struct s_filelist_entry el[ARBITRARY_MAXIMUM];
|
---|
| 709 | };
|
---|