|
MIDAS
|
#include "midas.h"#include "msystem.h"#include "mstrlcpy.h"#include <libgen.h>#include <mutex>#include <iostream>#include "mdsupport.h"#include <assert.h>#include <vector>#include <string>#include <algorithm>
Go to the source code of this file.
Classes | |
| struct | DIRLOG |
| struct | LAZY_SETTING |
| struct | LAZY_STATISTICS |
| struct | LAZY_INFO |
Macros | |
| #define | URL_SIZE 256 |
| #define | NOTHING_TODO 0 |
| #define | FORCE_EXIT 1 |
| #define | EXIT_REQUEST 2 |
| #define | TRY_LATER 3 |
| #define | NEW_FILE 1 |
| #define | REMOVE_FILE 2 |
| #define | REMOVE_ENTRY 3 |
| #define | MAX_LAZY_CHANNEL 100 |
| #define | TRACE |
| #define | LOG_TYPE_SCRIPT (-1) |
| #define | DONTOPENZIP 0 |
| #define | MAX_FILE_PATH 128 |
| #define | LAZY_SETTINGS_STRING "\Period = INT : 10\n\Maintain free space (%) = INT : 0\n\Stay behind = INT : 0\n\Alarm Class = STRING : [32]\n\Running condition = STRING : [128] ALWAYS\n\Data dir = STRING : [256] \n\Data format = STRING : [8] MIDAS\n\Filename format = STRING : [128] run%05d.mid\n\Backup type = STRING : [8] Tape\n\Execute after rewind = STRING : [64]\n\Path = STRING : [128] \n\Capacity (Bytes) = FLOAT : 5e9\n\List label= STRING : [128] \n\Execute before writing file = STRING : [64]\n\Execute after writing file = STRING : [64]\n\Modulo.Position = STRING : [8]\n\Copy Delay = INT : 0\n\Tape Data Append = BOOL : y\n\" |
| #define | LAZY_STATISTICS_STRING "\Backup file = STRING : [128] none \n\File size (Bytes) = DOUBLE : 0.0\n\KBytes copied = DOUBLE : 0.0\n\Total Bytes copied = DOUBLE : 0.0\n\Copy progress (%) = DOUBLE : 0\n\Copy Rate (Bytes per s) = DOUBLE : 0\n\Backup status (%) = DOUBLE : 0\n\Number of Files = INT : 0\n\Current Lazy run = INT : 0\n\" |
| #define | WATCHDOG_TIMEOUT 60000 /* 60 sec for tape access */ |
Typedefs | |
| typedef std::vector< DIRLOG > | DIRLOGLIST |
Functions | |
| bool | cmp_dirlog1 (const DIRLOG &a, const DIRLOG &b) |
| bool | cmp_dirlog (const DIRLOG &a, const DIRLOG &b) |
| INT | moduloCheck (INT lModulo, INT lPosition, INT lrun) |
| BOOL | lazy_file_exists (char *dir, char *file) |
| INT | lazy_main (INT, LAZY_INFO *, int max_event_size) |
| INT | lazy_copy (char *dev, char *file, int max_event_size) |
| INT | lazy_load_params (HNDLE hDB, HNDLE hKey) |
| INT | build_log_list (const char *fmt, const char *dir, DIRLOGLIST *plog) |
| INT | build_done_list_odb (HNDLE, INT **) |
| void | lazy_settings_hotlink (HNDLE hDB, HNDLE hKey, void *info) |
| void | lazy_maintain_check (HNDLE hKey, LAZY_INFO *pLall) |
| void | print_dirlog (const DIRLOGLIST *dirlog) |
| INT | lazy_trstop (INT rn, char *error) |
| INT | lazy_run_extract (const char *name) |
| INT | lazy_file_remove (const char *pufile) |
| INT | lazy_log_update (INT action, INT run, const char *label, const char *file, DWORD perf_time) |
| std::string | list_filename (const char *lazyname, const char *listname) |
| void | load_done_list (const char *lazyname, const DIRLOGLIST *dirlist, DIRLOGLIST *dlist) |
| int | save_list (const char *lazyname, const char *listname, const DIRLOGLIST *dlist) |
| void | convert_done_list (HNDLE hLch) |
| INT | build_done_list (HNDLE hLch, const DIRLOGLIST *pdirlist, DIRLOGLIST *pdone) |
| INT | save_done_list (HNDLE hLch, DIRLOGLIST *pdone) |
| int | find_next_file (const DIRLOGLIST *plog, const DIRLOGLIST *pdone) |
| INT | lazy_select_purge (HNDLE hKey, INT channel, LAZY_INFO *pLall, const char *fmt, const char *dir, DIRLOG *f) |
| void | lazy_statistics_update (INT cploop_time) |
| BOOL | condition_test (char *string) |
| BOOL | lazy_condition_check (void) |
| int | lazy_disk_copy_loop (const char *outfile, const char *infile, FILE *fpout, FILE *fpin) |
| INT | lazy_disk_copy (const char *outfile, const char *infile) |
| INT | lazy_maintain_free_space (LAZY_INFO *pLch, LAZY_INFO *pLall) |
| static void | watch_settings (HNDLE hDB, HNDLE hKey, HNDLE index, void *info) |
| int | main (int argc, char **argv) |
Variables | |
| BOOL | debug = FALSE |
| debug printouts | |
| BOOL | nodelete = FALSE |
| LAZY_SETTING | lazy |
| LAZY_STATISTICS | lazyst |
| LAZY_INFO | lazyinfo [MAX_LAZY_CHANNEL] = {{0, FALSE, "Tape"}} |
| INT | channel = -1 |
| INT | lazy_semaphore |
| HNDLE | hDB |
| main ODB handle | |
| HNDLE | hKey |
| HNDLE | pcurrent_hKey |
| double | lastsz |
| HNDLE | hKeyst |
| INT | run_state |
| INT | hDev |
| BOOL | msg_flag |
| BOOL | convert_flag = FALSE |
| BOOL | copy_continue = TRUE |
| INT | data_fmt |
| INT | dev_type |
| char | lazylog [MAX_STRING_LENGTH] |
| BOOL | full_bck_flag = FALSE |
| BOOL | maintain_touched = FALSE |
| INT | blockn = 0 |
| BOOL | stop_transition = FALSE |
| BOOL | delay_start = FALSE |
| DWORD | lazy_time = 0 |
| #define DONTOPENZIP 0 |
Definition at line 51 of file lazylogger.cxx.
| #define EXIT_REQUEST 2 |
Definition at line 42 of file lazylogger.cxx.
| #define FORCE_EXIT 1 |
Definition at line 41 of file lazylogger.cxx.
| #define LAZY_SETTINGS_STRING "\Period = INT : 10\n\Maintain free space (%) = INT : 0\n\Stay behind = INT : 0\n\Alarm Class = STRING : [32]\n\Running condition = STRING : [128] ALWAYS\n\Data dir = STRING : [256] \n\Data format = STRING : [8] MIDAS\n\Filename format = STRING : [128] run%05d.mid\n\Backup type = STRING : [8] Tape\n\Execute after rewind = STRING : [64]\n\Path = STRING : [128] \n\Capacity (Bytes) = FLOAT : 5e9\n\List label= STRING : [128] \n\Execute before writing file = STRING : [64]\n\Execute after writing file = STRING : [64]\n\Modulo.Position = STRING : [8]\n\Copy Delay = INT : 0\n\Tape Data Append = BOOL : y\n\" |
Definition at line 122 of file lazylogger.cxx.
| #define LAZY_STATISTICS_STRING "\Backup file = STRING : [128] none \n\File size (Bytes) = DOUBLE : 0.0\n\KBytes copied = DOUBLE : 0.0\n\Total Bytes copied = DOUBLE : 0.0\n\Copy progress (%) = DOUBLE : 0\n\Copy Rate (Bytes per s) = DOUBLE : 0\n\Backup status (%) = DOUBLE : 0\n\Number of Files = INT : 0\n\Current Lazy run = INT : 0\n\" |
Definition at line 142 of file lazylogger.cxx.
| #define LOG_TYPE_SCRIPT (-1) |
Definition at line 50 of file lazylogger.cxx.
| #define MAX_FILE_PATH 128 |
Definition at line 119 of file lazylogger.cxx.
| #define MAX_LAZY_CHANNEL 100 |
Definition at line 48 of file lazylogger.cxx.
| #define NEW_FILE 1 |
Definition at line 45 of file lazylogger.cxx.
| #define NOTHING_TODO 0 |
Definition at line 40 of file lazylogger.cxx.
| #define REMOVE_ENTRY 3 |
Definition at line 47 of file lazylogger.cxx.
| #define REMOVE_FILE 2 |
Definition at line 46 of file lazylogger.cxx.
| #define TRACE |
Definition at line 49 of file lazylogger.cxx.
| #define TRY_LATER 3 |
Definition at line 43 of file lazylogger.cxx.
| #define URL_SIZE 256 |
Definition at line 31 of file lazylogger.cxx.
| #define WATCHDOG_TIMEOUT 60000 /* 60 sec for tape access */ |
Definition at line 217 of file lazylogger.cxx.
| typedef std::vector<DIRLOG> DIRLOGLIST |
Definition at line 62 of file lazylogger.cxx.
| INT build_done_list | ( | HNDLE | hLch, |
| const DIRLOGLIST * | pdirlist, | ||
| DIRLOGLIST * | pdone | ||
| ) |
Definition at line 719 of file lazylogger.cxx.


Definition at line 488 of file lazylogger.cxx.


| INT build_log_list | ( | const char * | fmt, |
| const char * | dir, | ||
| DIRLOGLIST * | plog | ||
| ) |
Definition at line 392 of file lazylogger.cxx.


Definition at line 112 of file lazylogger.cxx.


Definition at line 64 of file lazylogger.cxx.

| BOOL condition_test | ( | char * | string | ) |
Definition at line 1051 of file lazylogger.cxx.


| void convert_done_list | ( | HNDLE | hLch | ) |
Definition at line 664 of file lazylogger.cxx.


| int find_next_file | ( | const DIRLOGLIST * | plog, |
| const DIRLOGLIST * | pdone | ||
| ) |
Definition at line 771 of file lazylogger.cxx.

| BOOL lazy_condition_check | ( | void | ) |
Definition at line 1136 of file lazylogger.cxx.


| INT lazy_copy | ( | char * | dev, |
| char * | file, | ||
| int | max_event_size | ||
| ) |
Definition at line 1163 of file lazylogger.cxx.


| INT lazy_disk_copy | ( | const char * | outfile, |
| const char * | infile | ||
| ) |
Definition at line 1615 of file lazylogger.cxx.


| int lazy_disk_copy_loop | ( | const char * | outfile, |
| const char * | infile, | ||
| FILE * | fpout, | ||
| FILE * | fpin | ||
| ) |
Definition at line 1333 of file lazylogger.cxx.


| BOOL lazy_file_exists | ( | char * | dir, |
| char * | file | ||
| ) |
Definition at line 1850 of file lazylogger.cxx.


| INT lazy_file_remove | ( | const char * | pufile | ) |
Definition at line 294 of file lazylogger.cxx.


Definition at line 316 of file lazylogger.cxx.


Definition at line 1975 of file lazylogger.cxx.


Definition at line 940 of file lazylogger.cxx.


Definition at line 1881 of file lazylogger.cxx.


| INT lazy_run_extract | ( | const char * | name | ) |
Definition at line 255 of file lazylogger.cxx.

| INT lazy_select_purge | ( | HNDLE | hKey, |
| INT | channel, | ||
| LAZY_INFO * | pLall, | ||
| const char * | fmt, | ||
| const char * | dir, | ||
| DIRLOG * | f | ||
| ) |
Definition at line 801 of file lazylogger.cxx.


| void lazy_statistics_update | ( | INT | cploop_time | ) |
Definition at line 1007 of file lazylogger.cxx.


Definition at line 248 of file lazylogger.cxx.

| std::string list_filename | ( | const char * | lazyname, |
| const char * | listname | ||
| ) |
Definition at line 572 of file lazylogger.cxx.


| void load_done_list | ( | const char * | lazyname, |
| const DIRLOGLIST * | dirlist, | ||
| DIRLOGLIST * | dlist | ||
| ) |
Definition at line 581 of file lazylogger.cxx.


| int main | ( | int | argc, |
| char ** | argv | ||
| ) |
Definition at line 2441 of file lazylogger.cxx.

Definition at line 369 of file lazylogger.cxx.

| void print_dirlog | ( | const DIRLOGLIST * | dirlog | ) |
| INT save_done_list | ( | HNDLE | hLch, |
| DIRLOGLIST * | pdone | ||
| ) |
Definition at line 750 of file lazylogger.cxx.


| int save_list | ( | const char * | lazyname, |
| const char * | listname, | ||
| const DIRLOGLIST * | dlist | ||
| ) |
Definition at line 624 of file lazylogger.cxx.


Definition at line 2419 of file lazylogger.cxx.


| INT blockn = 0 |
Definition at line 212 of file lazylogger.cxx.
| INT channel = -1 |
Definition at line 198 of file lazylogger.cxx.
Definition at line 207 of file lazylogger.cxx.
Definition at line 208 of file lazylogger.cxx.
| INT data_fmt |
Definition at line 209 of file lazylogger.cxx.
debug printouts
Definition at line 53 of file lazylogger.cxx.
Definition at line 214 of file lazylogger.cxx.
| INT dev_type |
Definition at line 209 of file lazylogger.cxx.
Definition at line 211 of file lazylogger.cxx.
| HNDLE hDB |
main ODB handle
Definition at line 202 of file lazylogger.cxx.
| INT hDev |
Definition at line 205 of file lazylogger.cxx.
| HNDLE hKey |
Definition at line 202 of file lazylogger.cxx.
| HNDLE hKeyst |
Definition at line 204 of file lazylogger.cxx.
| double lastsz |
Definition at line 203 of file lazylogger.cxx.
| LAZY_SETTING lazy |
Definition at line 175 of file lazylogger.cxx.
| INT lazy_semaphore |
Definition at line 201 of file lazylogger.cxx.
| DWORD lazy_time = 0 |
Definition at line 215 of file lazylogger.cxx.
| LAZY_INFO lazyinfo[MAX_LAZY_CHANNEL] = {{0, FALSE, "Tape"}} |
Definition at line 196 of file lazylogger.cxx.
| char lazylog[MAX_STRING_LENGTH] |
Definition at line 210 of file lazylogger.cxx.
| LAZY_STATISTICS lazyst |
Definition at line 188 of file lazylogger.cxx.
Definition at line 211 of file lazylogger.cxx.
| BOOL msg_flag |
Definition at line 206 of file lazylogger.cxx.
Definition at line 54 of file lazylogger.cxx.
| HNDLE pcurrent_hKey |
Definition at line 202 of file lazylogger.cxx.
| INT run_state |
Definition at line 205 of file lazylogger.cxx.
Definition at line 213 of file lazylogger.cxx.