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