[1] | 1 | /***************************************************************************
|
---|
[2211] | 2 | $Id: mondoarchive.c 2508 2010-01-04 18:21:55Z bruno $
|
---|
| 3 | * The main file for mondoarchive.
|
---|
| 4 | */
|
---|
[1] | 5 |
|
---|
| 6 | /************************* #include statements *************************/
|
---|
| 7 | #include <pthread.h>
|
---|
| 8 | #include <stdio.h>
|
---|
| 9 | #include <stdlib.h>
|
---|
[1930] | 10 | #include "my-stuff.h"
|
---|
[2211] | 11 | #include "mr_mem.h"
|
---|
[2421] | 12 | #include "mr_str.h"
|
---|
[1] | 13 | #include "../common/mondostructures.h"
|
---|
| 14 | #include "../common/libmondo.h"
|
---|
[1917] | 15 | #include "../common/libmondo-cli-EXT.h"
|
---|
[1383] | 16 | #include "../common/libmondo-tools-EXT.h"
|
---|
[1315] | 17 | #include "mondoarchive.h"
|
---|
[1] | 18 |
|
---|
| 19 | // for CVS
|
---|
[128] | 20 | //static char cvsid[] = "$Id: mondoarchive.c 2508 2010-01-04 18:21:55Z bruno $";
|
---|
[1] | 21 |
|
---|
| 22 | /************************* external variables *************************/
|
---|
| 23 | extern void set_signals(int);
|
---|
| 24 | extern int g_current_media_number;
|
---|
| 25 | extern int g_currentY;
|
---|
| 26 | extern bool g_text_mode;
|
---|
| 27 | extern char *g_boot_mountpt;
|
---|
[1736] | 28 | extern bool g_remount_floppy_at_end;
|
---|
[1] | 29 | extern char *g_cdrw_drive_is_here;
|
---|
[128] | 30 | static char *g_cdrom_drive_is_here = NULL;
|
---|
| 31 | static char *g_dvd_drive_is_here = NULL;
|
---|
[1] | 32 | extern double g_kernel_version;
|
---|
| 33 |
|
---|
| 34 | /***************** global vars, used only by main.c ******************/
|
---|
[2322] | 35 | long diffs = 0L;
|
---|
[1] | 36 |
|
---|
| 37 | extern t_bkptype g_backup_media_type;
|
---|
| 38 | extern int g_loglevel;
|
---|
[2340] | 39 | extern char *g_magicdev_command;
|
---|
[1] | 40 |
|
---|
[1917] | 41 | /**
|
---|
| 42 | * Whether we're restoring from ISOs. Obviously not, since this is the
|
---|
| 43 | * backup program.
|
---|
| 44 | * @note You @b MUST declare this variable somewhere in your program if
|
---|
| 45 | * you use libmondo. Otherwise the link will fail.
|
---|
| 46 | * @ingroup globalGroup
|
---|
| 47 | */
|
---|
| 48 | bool g_ISO_restore_mode = FALSE;
|
---|
| 49 |
|
---|
| 50 | /* Do we use extended attributes and acl ?
|
---|
| 51 | * * By default no, use --acl & --attr options to force their usage */
|
---|
| 52 | char *g_getfacl = NULL;
|
---|
| 53 | char *g_getfattr = NULL;
|
---|
| 54 |
|
---|
[1645] | 55 | /* Reference to global bkpinfo */
|
---|
| 56 | struct s_bkpinfo *bkpinfo;
|
---|
| 57 |
|
---|
[2320] | 58 | /* Make cleanup the finish function */
|
---|
| 59 | void (*mr_cleanup)(int) = finish;
|
---|
[2211] | 60 |
|
---|
[1967] | 61 | /* To be coded */
|
---|
| 62 | void free_MR_global_filenames(void) {
|
---|
| 63 | }
|
---|
| 64 |
|
---|
[1] | 65 | /****************** subroutines used only by main.c ******************/
|
---|
| 66 |
|
---|
| 67 |
|
---|
| 68 | /**
|
---|
| 69 | * Print a "don't panic" message to the log and a message about the logfile to the screen.
|
---|
| 70 | */
|
---|
[1236] | 71 | void welcome_to_mondoarchive(void)
|
---|
[1] | 72 | {
|
---|
[1375] | 73 | char *tmp = NULL;
|
---|
| 74 |
|
---|
[2340] | 75 | log_msg(0, "Mondo Archive v%s --- http://www.mondorescue.org", PACKAGE_VERSION);
|
---|
[1375] | 76 | log_msg(0, "running %s binaries", get_architecture());
|
---|
| 77 | tmp = get_uname_m();
|
---|
| 78 | log_msg(0, "running on %s architecture", tmp);
|
---|
[2241] | 79 | mr_free(tmp);
|
---|
[2340] | 80 | log_msg(0, "-----------------------------------------------------------");
|
---|
| 81 | log_msg(0, "NB: Mondo logs almost everything, so don't panic if you see");
|
---|
| 82 | log_msg(0, "some error messages. Please read them carefully before you");
|
---|
| 83 | log_msg(0, "decide to break out in a cold sweat. Despite (or perhaps");
|
---|
| 84 | log_msg(0, "because of) the wealth of messages. some users are inclined");
|
---|
| 85 | log_msg(0, "to stop reading this log. If Mondo stopped for some reason,");
|
---|
| 86 | log_msg(0, "chances are it's detailed here. More than likely there's a");
|
---|
| 87 | log_msg(0, "message at the very end of this log that will tell you what");
|
---|
| 88 | log_msg(0, "is wrong. Please read it! -Devteam");
|
---|
| 89 | log_msg(0, "-----------------------------------------------------------");
|
---|
[1] | 90 |
|
---|
[128] | 91 | log_msg(0, "Zero...");
|
---|
| 92 | log_msg(1, "One...");
|
---|
| 93 | log_msg(2, "Two...");
|
---|
| 94 | log_msg(3, "Three...");
|
---|
| 95 | log_msg(4, "Four...");
|
---|
| 96 | log_msg(5, "Five...");
|
---|
| 97 | log_msg(6, "Six...");
|
---|
| 98 | log_msg(7, "Seven...");
|
---|
| 99 | log_msg(8, "Eight...");
|
---|
[1] | 100 | }
|
---|
| 101 |
|
---|
| 102 |
|
---|
| 103 | /**
|
---|
| 104 | * Do whatever is necessary to insure a successful backup on the Linux distribution
|
---|
| 105 | * of the day.
|
---|
| 106 | */
|
---|
[1236] | 107 | void distro_specific_kludges_at_start_of_mondoarchive(void)
|
---|
[1] | 108 | {
|
---|
[128] | 109 | log_msg(2, "Unmounting old ramdisks if necessary");
|
---|
| 110 | stop_magicdev_if_necessary(); // for RH+Gnome users
|
---|
[2030] | 111 | /*
|
---|
[128] | 112 | run_program_and_log_output
|
---|
| 113 | ("umount `mount | grep shm | grep mondo | cut -d' ' -f3`", 2);
|
---|
[2030] | 114 | */
|
---|
[128] | 115 | unmount_supermounts_if_necessary(); // for Mandrake users whose CD-ROMs are supermounted
|
---|
| 116 | // stop_autofs_if_necessary(); // for Xandros users
|
---|
| 117 | mount_boot_if_necessary(); // for Gentoo users with non-mounted /boot partitions
|
---|
| 118 | clean_up_KDE_desktop_if_necessary(); // delete various misc ~/.* files that get in the way
|
---|
[1] | 119 | }
|
---|
| 120 |
|
---|
| 121 |
|
---|
| 122 |
|
---|
| 123 | /**
|
---|
| 124 | * Undo whatever was done by distro_specific_kludges_at_start_of_mondoarchive().
|
---|
| 125 | */
|
---|
[1236] | 126 | void distro_specific_kludges_at_end_of_mondoarchive(void)
|
---|
[1] | 127 | {
|
---|
[128] | 128 | log_msg(2, "Restarting magicdev if necessary");
|
---|
| 129 | sync();
|
---|
| 130 | restart_magicdev_if_necessary(); // for RH+Gnome users
|
---|
[1] | 131 |
|
---|
[128] | 132 | log_msg(2, "Restarting autofs if necessary");
|
---|
| 133 | sync();
|
---|
| 134 | // restart_autofs_if_necessary(); // for Xandros users
|
---|
[1] | 135 |
|
---|
[128] | 136 | log_msg(2, "Restarting supermounts if necessary");
|
---|
| 137 | sync();
|
---|
| 138 | remount_supermounts_if_necessary(); // for Mandrake users
|
---|
[1] | 139 |
|
---|
[128] | 140 | log_msg(2, "Unmounting /boot if necessary");
|
---|
| 141 | sync();
|
---|
| 142 | unmount_boot_if_necessary(); // for Gentoo users
|
---|
[1] | 143 |
|
---|
| 144 | // log_msg( 2, "Cleaning up KDE desktop");
|
---|
| 145 | // clean_up_KDE_desktop_if_necessary();
|
---|
| 146 | }
|
---|
| 147 |
|
---|
| 148 |
|
---|
| 149 | /**
|
---|
| 150 | * Backup/verify the user's data.
|
---|
| 151 | * What did you think it did, anyway? :-)
|
---|
| 152 | */
|
---|
[128] | 153 | int main(int argc, char *argv[])
|
---|
[1] | 154 | {
|
---|
[2241] | 155 | char *tmp = NULL;
|
---|
[2113] | 156 | char *tmp1 = NULL;
|
---|
[2322] | 157 | int res = 0;
|
---|
| 158 | int i = 0;
|
---|
| 159 | int retval = 0;
|
---|
[2211] | 160 | char *say_at_end = NULL;
|
---|
[1] | 161 |
|
---|
[2321] | 162 | printf("Initializing...\n");
|
---|
| 163 |
|
---|
[810] | 164 | /* initialize log file with time stamp */
|
---|
| 165 | unlink(MONDO_LOGFILE);
|
---|
[2421] | 166 | tmp = mr_date();
|
---|
| 167 | log_msg(0, "Time started: %s", tmp);
|
---|
| 168 | mr_free(tmp);
|
---|
[1] | 169 |
|
---|
[2421] | 170 | init_bkpinfo();
|
---|
| 171 |
|
---|
[2321] | 172 | /* Memory allocation is done in those functions */
|
---|
| 173 | malloc_libmondo_global_strings();
|
---|
| 174 | if (argc == 1) {
|
---|
| 175 | g_text_mode = FALSE;
|
---|
| 176 | } else {
|
---|
| 177 | g_text_mode = TRUE;
|
---|
[2322] | 178 | /* newt mode if -g specified on cli */
|
---|
| 179 | for (i = 0; i < argc; i++) {
|
---|
| 180 | if (!strcmp(argv[i],"-g")) {
|
---|
| 181 | g_text_mode = FALSE;
|
---|
| 182 | }
|
---|
| 183 | }
|
---|
[2321] | 184 | }
|
---|
| 185 | setup_newt_stuff();
|
---|
| 186 |
|
---|
| 187 | /* Make sure I'm root; abort if not */
|
---|
| 188 | if (getuid() != 0) {
|
---|
| 189 | fatal_error("Please run as root.\n");
|
---|
| 190 | }
|
---|
| 191 |
|
---|
| 192 | /* If -V, -v or --version then echo version no. and quit */
|
---|
| 193 | if (argc == 2 && (!strcmp(argv[argc - 1], "-v") || !strcmp(argv[argc - 1], "-V") || !strcmp(argv[argc - 1], "--version"))) {
|
---|
| 194 | printf("mondoarchive v%s\nSee man page for help\n", PACKAGE_VERSION);
|
---|
| 195 | finish(0);
|
---|
| 196 | }
|
---|
| 197 |
|
---|
| 198 |
|
---|
[807] | 199 | /* make sure PATH environmental variable allows access to mkfs, fdisk, etc. */
|
---|
[2323] | 200 | mr_asprintf(tmp1,"%s:/sbin:/usr/sbin:/usr/local/sbin",getenv("PATH"));
|
---|
[2113] | 201 | setenv("PATH", tmp1, 1);
|
---|
[2321] | 202 | mr_free(tmp1);
|
---|
[1] | 203 |
|
---|
[807] | 204 | /* Add the ARCH environment variable for ia64 purposes */
|
---|
[2323] | 205 | mr_asprintf(tmp1,"%s",get_architecture());
|
---|
[2113] | 206 | setenv("ARCH", tmp1, 1);
|
---|
[2321] | 207 | mr_free(tmp1);
|
---|
[1] | 208 |
|
---|
[424] | 209 | /* Add MONDO_SHARE environment variable for mindi */
|
---|
| 210 | setenv_mondo_share();
|
---|
[258] | 211 |
|
---|
[807] | 212 | /* Configure the bkpinfo structure, global file paths, etc. */
|
---|
[128] | 213 | g_main_pid = getpid();
|
---|
| 214 | log_msg(9, "This");
|
---|
[1] | 215 |
|
---|
[128] | 216 | set_signals(TRUE); // catch SIGTERM, etc.
|
---|
| 217 | run_program_and_log_output("dmesg -n1", TRUE);
|
---|
[1] | 218 |
|
---|
[128] | 219 | log_msg(9, "Next");
|
---|
[1747] | 220 | make_hole_for_dir(MONDO_CACHE);
|
---|
| 221 |
|
---|
[128] | 222 | welcome_to_mondoarchive();
|
---|
| 223 | distro_specific_kludges_at_start_of_mondoarchive();
|
---|
| 224 | g_kernel_version = get_kernel_version();
|
---|
[1] | 225 |
|
---|
[128] | 226 | if (argc == 4 && !strcmp(argv[1], "getfattr")) {
|
---|
| 227 | g_loglevel = 10;
|
---|
| 228 | if (!strstr(argv[2], "filelist")) {
|
---|
[541] | 229 | printf("Sorry - filelist goes first\n");
|
---|
[128] | 230 | finish(1);
|
---|
| 231 | } else {
|
---|
| 232 | finish(get_fattr_list(argv[2], argv[3]));
|
---|
| 233 | }
|
---|
| 234 | finish(0);
|
---|
[1] | 235 | }
|
---|
[128] | 236 | if (argc == 4 && !strcmp(argv[1], "setfattr")) {
|
---|
| 237 | g_loglevel = 10;
|
---|
| 238 | finish(set_fattr_list(argv[2], argv[3]));
|
---|
[1] | 239 | }
|
---|
[128] | 240 |
|
---|
| 241 | if (argc == 3 && !strcmp(argv[1], "wildcards")) {
|
---|
| 242 | g_loglevel = 10;
|
---|
[2413] | 243 | tmp = mr_stresc(argv[2], "[]*?", '\\');
|
---|
[128] | 244 | printf("in=%s; out=%s\n", argv[2], tmp);
|
---|
[2413] | 245 | mr_free(tmp);
|
---|
[128] | 246 | finish(1);
|
---|
[1] | 247 | }
|
---|
[128] | 248 |
|
---|
| 249 | if (argc == 4 && !strcmp(argv[1], "getfacl")) {
|
---|
| 250 | g_loglevel = 10;
|
---|
| 251 | if (!strstr(argv[2], "filelist")) {
|
---|
[541] | 252 | printf("Sorry - filelist goes first\n");
|
---|
[128] | 253 | finish(1);
|
---|
| 254 | } else {
|
---|
| 255 | finish(get_acl_list(argv[2], argv[3]));
|
---|
| 256 | }
|
---|
| 257 | finish(0);
|
---|
| 258 | }
|
---|
| 259 | if (argc == 4 && !strcmp(argv[1], "setfacl")) {
|
---|
| 260 | g_loglevel = 10;
|
---|
| 261 | finish(set_acl_list(argv[2], argv[3]));
|
---|
| 262 | }
|
---|
[1] | 263 |
|
---|
[128] | 264 | if (argc > 2 && !strcmp(argv[1], "find-cd")) {
|
---|
| 265 | g_loglevel = 10;
|
---|
[2325] | 266 | if ((tmp = find_cdrw_device()) == NULL) {
|
---|
[541] | 267 | printf("Failed to find CDR-RW drive\n");
|
---|
[128] | 268 | } else {
|
---|
[541] | 269 | printf("CD-RW is at %s\n", tmp);
|
---|
[128] | 270 | }
|
---|
[2325] | 271 | mr_free(tmp);
|
---|
| 272 | if ((tmp = find_cdrom_device(FALSE)) == NULL) {
|
---|
[541] | 273 | printf("Failed to find CD-ROM drive\n");
|
---|
[128] | 274 | } else {
|
---|
[541] | 275 | printf("CD-ROM is at %s\n", tmp);
|
---|
[128] | 276 | }
|
---|
[2325] | 277 | mr_free(tmp);
|
---|
[128] | 278 | finish(0);
|
---|
| 279 | }
|
---|
[1] | 280 |
|
---|
[128] | 281 | if (argc > 2 && !strcmp(argv[1], "find-dvd")) {
|
---|
| 282 | g_loglevel = 10;
|
---|
[2325] | 283 | if ((tmp = find_dvd_device()) == NULL) {
|
---|
[541] | 284 | printf("Failed to find DVD drive\n");
|
---|
[128] | 285 | } else {
|
---|
[541] | 286 | printf("DVD is at %s\n", tmp);
|
---|
[128] | 287 | }
|
---|
[2325] | 288 | mr_free(tmp);
|
---|
[128] | 289 | finish(0);
|
---|
| 290 | }
|
---|
[1] | 291 |
|
---|
[128] | 292 | if (argc > 2 && !strcmp(argv[1], "disksize")) {
|
---|
| 293 | printf("%s --> %ld\n", argv[2], get_phys_size_of_drive(argv[2]));
|
---|
| 294 | finish(0);
|
---|
| 295 | }
|
---|
| 296 | if (argc > 2 && !strcmp(argv[1], "test-dev")) {
|
---|
| 297 | if (is_dev_an_NTFS_dev(argv[2])) {
|
---|
[541] | 298 | printf("%s is indeed an NTFS dev\n", argv[2]);
|
---|
[128] | 299 | } else {
|
---|
[541] | 300 | printf("%s is _not_ an NTFS dev\n", argv[2]);
|
---|
[128] | 301 | }
|
---|
| 302 | finish(0);
|
---|
| 303 | }
|
---|
| 304 |
|
---|
[1645] | 305 | if (pre_param_configuration()) {
|
---|
[2340] | 306 | fatal_error("Pre-param initialization phase failed. Please review the error messages above, make the specified changes, then try again. Exiting...");
|
---|
[128] | 307 | }
|
---|
| 308 |
|
---|
[2340] | 309 | /* Process command line, if there is one. If not, ask user for info. */
|
---|
[128] | 310 | if (argc == 1) {
|
---|
[1645] | 311 | res = interactively_obtain_media_parameters_from_user(TRUE); /* yes, archiving */
|
---|
[128] | 312 | if (res) {
|
---|
[2340] | 313 | fatal_error("Syntax error. Please review the parameters you have supplied and try again.");
|
---|
[128] | 314 | }
|
---|
| 315 | } else {
|
---|
[1645] | 316 | res = handle_incoming_parameters(argc, argv);
|
---|
[128] | 317 | if (res) {
|
---|
[2340] | 318 | printf("Errors were detected in the command line you supplied.\n");
|
---|
[1319] | 319 | printf("Please review the log file - %s\n", MONDO_LOGFILE );
|
---|
[128] | 320 | log_msg(1, "Mondoarchive will now exit.");
|
---|
| 321 | finish(1);
|
---|
| 322 | }
|
---|
[1] | 323 | }
|
---|
| 324 |
|
---|
| 325 | /* Finish configuring global structures */
|
---|
[1645] | 326 | if (post_param_configuration()) {
|
---|
[2321] | 327 | fatal_error("Post-param initialization phase failed. Perhaps bad parameters were supplied to mondoarchive? Please review the documentation, error messages and logs. Exiting...");
|
---|
[128] | 328 | }
|
---|
[1] | 329 |
|
---|
[128] | 330 | /* If we're meant to backup then backup */
|
---|
| 331 | if (bkpinfo->backup_data) {
|
---|
[1645] | 332 | res = backup_data();
|
---|
[128] | 333 | retval += res;
|
---|
| 334 | if (res) {
|
---|
[2323] | 335 | mr_asprintf(say_at_end, "Data archived. Please check the logs, just as a precaution. ");
|
---|
[128] | 336 | } else {
|
---|
[2323] | 337 | mr_asprintf(say_at_end, "Data archived OK. ");
|
---|
[128] | 338 | }
|
---|
| 339 | }
|
---|
[1] | 340 |
|
---|
| 341 | /* If we're meant to verify then verify */
|
---|
[128] | 342 | if (bkpinfo->verify_data) {
|
---|
[1645] | 343 | res = verify_data();
|
---|
[128] | 344 | if (res < 0) {
|
---|
[2324] | 345 | mr_asprintf(tmp, "%d difference%c found.", -res, (-res != 1) ? 's' : ' ');
|
---|
[2323] | 346 | mr_asprintf(say_at_end, "%s", tmp);
|
---|
[128] | 347 | log_to_screen(tmp);
|
---|
[2241] | 348 | mr_free(tmp);
|
---|
[128] | 349 | res = 0;
|
---|
| 350 | }
|
---|
| 351 | retval += res;
|
---|
| 352 | }
|
---|
[1] | 353 |
|
---|
| 354 | /* Report result of entire operation (success? errors?) */
|
---|
[128] | 355 | if (!retval) {
|
---|
| 356 | mvaddstr_and_log_it(g_currentY++, 0,
|
---|
[541] | 357 | "Backup and/or verify ran to completion. Everything appears to be fine.");
|
---|
[128] | 358 | } else {
|
---|
| 359 | mvaddstr_and_log_it(g_currentY++, 0,
|
---|
[541] | 360 | "Backup and/or verify ran to completion. However, errors did occur.");
|
---|
[128] | 361 | }
|
---|
[1] | 362 |
|
---|
[1437] | 363 | if (does_file_exist(MINDI_CACHE"/mondorescue.iso")) {
|
---|
[128] | 364 | log_to_screen
|
---|
[1437] | 365 | (MINDI_CACHE"/mondorescue.iso, a boot/utility CD, is available if you want it.");
|
---|
[128] | 366 | }
|
---|
[1] | 367 |
|
---|
[1747] | 368 | if (length_of_file(MONDO_CACHE"/changed.files") > 2) {
|
---|
[128] | 369 | if (g_text_mode) {
|
---|
[1747] | 370 | log_to_screen("Type 'less "MONDO_CACHE"/changed.files' to see which files don't match the archives");
|
---|
[128] | 371 | } else {
|
---|
[1747] | 372 | log_msg(1, "Type 'less "MONDO_CACHE"/changed.files' to see which files don't match the archives");
|
---|
[128] | 373 | log_msg(2, "Calling popup_changelist_from_file()");
|
---|
[1747] | 374 | popup_changelist_from_file(MONDO_CACHE"/changed.files");
|
---|
[128] | 375 | log_msg(2, "Returned from popup_changelist_from_file()");
|
---|
| 376 | }
|
---|
| 377 | } else {
|
---|
[1747] | 378 | unlink(MONDO_CACHE"/changed.files");
|
---|
[128] | 379 | }
|
---|
[2211] | 380 | if (say_at_end != NULL) {
|
---|
| 381 | log_to_screen(say_at_end);
|
---|
[2321] | 382 | mr_free(say_at_end);
|
---|
[2211] | 383 | }
|
---|
[2323] | 384 | mr_asprintf(tmp, "umount %s/tmpfs", bkpinfo->tmpdir);
|
---|
[128] | 385 | run_program_and_log_output(tmp, TRUE);
|
---|
[2241] | 386 | mr_free(tmp);
|
---|
[1697] | 387 | if (bkpinfo->backup_media_type == usb) {
|
---|
| 388 | log_msg(1, "Unmounting USB device.");
|
---|
[2325] | 389 | if (bkpinfo->media_device == NULL) {
|
---|
| 390 | fatal_error("USB device set to NULL");
|
---|
| 391 | }
|
---|
[2323] | 392 | mr_asprintf(tmp, "umount %s1", bkpinfo->media_device);
|
---|
[1697] | 393 | run_program_and_log_output(tmp, TRUE);
|
---|
[2241] | 394 | mr_free(tmp);
|
---|
[1697] | 395 | }
|
---|
[1] | 396 |
|
---|
[128] | 397 | run_program_and_log_output("mount", 2);
|
---|
[1] | 398 |
|
---|
[1747] | 399 | system("rm -f "MONDO_CACHE"/last-backup.aborted");
|
---|
[128] | 400 | if (!retval) {
|
---|
[541] | 401 | printf("Mondoarchive ran OK.\n");
|
---|
[128] | 402 | } else {
|
---|
[541] | 403 | printf("Errors occurred during backup. Please check logfile.\n");
|
---|
[128] | 404 | }
|
---|
| 405 | distro_specific_kludges_at_end_of_mondoarchive();
|
---|
| 406 | set_signals(FALSE);
|
---|
[1644] | 407 |
|
---|
[128] | 408 | free_libmondo_global_strings();
|
---|
[1703] | 409 |
|
---|
[1] | 410 |
|
---|
[128] | 411 | if (!g_cdrom_drive_is_here) {
|
---|
| 412 | log_msg(10, "FYI, g_cdrom_drive_is_here was never used");
|
---|
| 413 | }
|
---|
| 414 | if (!g_dvd_drive_is_here) {
|
---|
| 415 | log_msg(10, "FYI, g_dvd_drive_is_here was never used");
|
---|
| 416 | }
|
---|
[1] | 417 |
|
---|
[810] | 418 | /* finalize log file with time stamp */
|
---|
[2421] | 419 | tmp = mr_date();
|
---|
| 420 | log_msg(0, "Time finished: %s", tmp);
|
---|
| 421 | mr_free(tmp);
|
---|
[810] | 422 |
|
---|
[1708] | 423 | chdir("/tmp");
|
---|
[1644] | 424 |
|
---|
[128] | 425 | if (!g_text_mode) {
|
---|
[2322] | 426 | popup_and_OK("Mondo Archive has finished its run. Please press ENTER to return to the shell prompt.");
|
---|
[541] | 427 | log_to_screen("See %s for details of backup run.", MONDO_LOGFILE);
|
---|
[128] | 428 | } else {
|
---|
[541] | 429 | printf("See %s for details of backup run.\n", MONDO_LOGFILE);
|
---|
[128] | 430 | }
|
---|
[1703] | 431 | finish(retval);
|
---|
[128] | 432 |
|
---|
| 433 | return EXIT_SUCCESS;
|
---|
[1] | 434 | }
|
---|