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