mondo  3.3.0
About: Mondo (like Mindi part of MondoRescue, a disaster recovery suite for Linux/FreeBSD) is responsible for carrying out the actual backups and and restores
  Fossies Dox: mondo-3.3.0.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

libmondo-archive.c File Reference
#include "my-stuff.h"
#include "mr_mem.h"
#include "mr_str.h"
#include "mr_sys.h"
#include "mr_file.h"
#include "mondostructures.h"
#include "libmondo-string-EXT.h"
#include "libmondo-stream-EXT.h"
#include "libmondo-devices-EXT.h"
#include "libmondo-tools-EXT.h"
#include "libmondo-gui-EXT.h"
#include "libmondo-fork-EXT.h"
#include "libmondo-files-EXT.h"
#include "libmondo-filelist-EXT.h"
#include "libmondo-verify-EXT.h"
#include "libmondo-archive.h"
#include "lib-common-externs.h"
#include <sys/sem.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <stdarg.h>
#include <unistd.h>
Include dependency graph for libmondo-archive.c:

Go to the source code of this file.

Data Structures

union  semun
 The semaphore union, provided only in case the user's system doesn't. More...
 

Macros

#define DVDRWFORMAT   1
 
#define _SEMUN_H
 
#define MAX_NOOF_SETS_HERE   32767
 Maximum number of filesets allowed in this function. More...
 
#define BKPINFO_LOC_OFFSET   (16+MAX_NOOF_SETS_HERE/8+16)
 Offset of the bkpinfo pointer (in bytes) from the buffer passed to create_afio_files_in_background. More...
 

Functions

char * get_non_rewind_dev (char *)
 Return the non-rewinding device when passed the normal one. More...
 
static int set_semvalue (void)
 Initialize the semaphore. More...
 
static void del_semvalue (void)
 Frees (deletes) the semaphore. More...
 
static int semaphore_p (void)
 Acquire (increment) the semaphore (change status to P). More...
 
static int semaphore_v (void)
 Free (decrement) the semaphore (change status to V). More...
 
int archive_this_fileset (char *filelist, char *fname, int setno)
 Call afio to archive the filelist filelist to the file fname. More...
 
int backup_data ()
 Wrapper function for all the backup commands. More...
 
int call_mindi_to_supply_boot_disks ()
 Call Mindi to generate boot and data disks. More...
 
void * create_afio_files_in_background (void *inbuf)
 Main function for each afio thread. More...
 
int do_that_final_phase ()
 Finalize the backup. More...
 
int do_that_initial_phase ()
 Initialize the backup. More...
 
int get_bit_N_of_array (char *array, int N)
 Get the Nth bit of array. More...
 
int make_afioballs_and_images ()
 Start up threads to archive your files. More...
 
void pause_for_N_seconds (int how_long, char *msg)
 
int make_usb_fs ()
 Create a USB image in destfile, from files in bkpinfo->scratchdir. More...
 
int make_iso_fs (char *destfile)
 Create an ISO image in destfile, from files in bkpinfo->scratchdir. More...
 
int is_dev_an_NTFS_dev (char *bigfile_fname)
 
int make_slices_and_images (char *biggielist_fname)
 Back up big files by chopping them up. More...
 
int make_afioballs_and_images_OLD ()
 Single-threaded version of make_afioballs_and_images(). More...
 
int make_those_afios_phase ()
 Wrapper around make_afioballs_and_images(). More...
 
int make_those_slices_phase ()
 Wrapper around make_slices_and_images(). More...
 
int _move_files_to_cd (char *files_to_add,...)
 Move some files to the ISO scratch directory. More...
 
int _move_files_to_stream (char *files_to_add,...)
 Copy some files to tape. More...
 
int interrogate_disk_currently_in_cdrw_drive (char *cdrw_dev, int keep_looping)
 Make sure the user has a valid CD-R(W) in the CD drive. More...
 
void pause_and_ask_for_cdr (int ask_for_one_if_more_than_this, int *pmountable)
 Asks the user to put a CD-R(W) in the drive. More...
 
void set_bit_N_of_array (char *array, int N, int true_or_false)
 Set the Nth bit of array to true_or_false. More...
 
int slice_up_file_etc (char *biggie_filename, char *ntfsprog_fifo, long biggie_file_number, long noof_biggie_files, int use_ntfsprog)
 Chop up filename. More...
 
void wipe_archives (char *d)
 Remove the archives in d. More...
 
int write_final_iso_if_necessary ()
 Write the final ISO image. More...
 
int write_iso_and_go_on (int last_cd)
 Write an ISO image to [bkpinfo->isodir]/bkpinfo->prefix-[g_current_media_number].iso. More...
 
int verify_data ()
 Verify the user's data. More...
 
void setenv_mondo_share (void)
 

Variables

int g_current_media_number
 The current media number we're using. More...
 
int g_currentY
 The row to write background progress messages to. Incremented each time a message is written. More...
 
int g_text_mode
 If FALSE, use a newt interface; if TRUE, use an ugly (but more compatible) dumb terminal interface. More...
 
int g_exiting
 Whether we are currently in a nested call of fatal_error(). More...
 
long g_current_progress
 The current amount of progress (filelist #, etc.) for the currently opened progress form. More...
 
FILE * g_tape_stream
 The file pointer for the opened tape/CD stream. More...
 
long long g_tape_posK
 The position (in kilobytes) where we are on the tape. More...
 
int g_cd_recovery
 TRUE if we're making an "autonuke" backup. More...
 
char * g_mondo_home
 The location of Mondo's home directory. More...
 
char * g_serial_string = NULL
 The serial string (used to differentiate between backups) of the current backup. More...
 
char * g_getfacl
 
char * g_getfattr
 
char * MONDO_LOGFILE
 Compatibility #define to ease the transition to logfile-in-a-variable. More...
 
char * MONDO_LOGFILENAME
 Compatibility #define to ease the transition to logfile-in-a-variable. More...
 
struct s_bkpinfobkpinfo
 
t_bkptype g_backup_media_type = none
 The current backup media type in use. More...
 
int g_current_thread_no = 0
 Incremented by each archival thread when it starts up. More...
 
int g_noof_rows
 The number of rows on the screen. More...
 
static int g_sem_id
 
static int g_sem_key
 
int g_tape_buffer_size_MB
 Size in megabytes of the buffer afforded to the executable "buffer". More...
 
int(* move_files_to_cd )(char *,...)
 Function pointer to an appropriate move_files_to_cd routine. More...
 
int(* move_files_to_stream )(char *,...)
 Function pointer to an appropriate move_files_to_stream routine. More...
 

Detailed Description

Functions to handle backing up data. This is the main file (at least the longest one) in libmondo.

Definition in file libmondo-archive.c.

Macro Definition Documentation

◆ _SEMUN_H

#define _SEMUN_H

Definition at line 41 of file libmondo-archive.c.

◆ DVDRWFORMAT

#define DVDRWFORMAT   1

Definition at line 36 of file libmondo-archive.c.

Variable Documentation

◆ bkpinfo

◆ g_getfacl

◆ g_getfattr

◆ MONDO_LOGFILE

◆ MONDO_LOGFILENAME

char* MONDO_LOGFILENAME

Compatibility #define to ease the transition to logfile-in-a-variable.

Definition at line 10 of file mondoarchive.h.

Referenced by make_usb_fs().