* Version $Id$
*/
/*
- Copyright (C) 2000-2006 Kern Sibbald
+ Copyright (C) 2006-2006 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
#ifndef __RUNSCRIPT_H_
#define __RUNSCRIPT_H_ 1
-#if defined(FILE_DAEMON) || defined(DIRECTOR_DAEMON)
-# define USE_RUNSCRIPT
-#endif
-
-#ifdef USE_RUNSCRIPT
-
/* Usage:
*
* #define USE_RUNSCRIPT
*/
/*
- * RUNSCRIPT->when can take following value :
+ * RUNSCRIPT->when can take following bit values:
*/
enum {
SCRIPT_Never = 0,
- SCRIPT_After = 1, /* AfterJob */
- SCRIPT_Before = 2, /* BeforeJob */
- SCRIPT_Any = 3 /* Before and After */
+ SCRIPT_After = (1<<0), /* AfterJob */
+ SCRIPT_Before = (1<<1), /* BeforeJob */
+ SCRIPT_Any = SCRIPT_Before | SCRIPT_After
};
/*
*/
class RUNSCRIPT {
public:
- POOLMEM *command; /* command string */
- POOLMEM *target; /* host target */
- char level; /* Base|Full|Incr...|All (NYI) */
- bool on_success; /* executre command on job success (After) */
+ POOLMEM *command; /* command string */
+ POOLMEM *target; /* host target */
+ char level; /* Base|Full|Incr...|All (NYI) */
+ bool on_success; /* executre command on job success (After) */
bool on_failure; /* executre command on job failure (After) */
bool abort_on_error; /* abort job on error (Before) */
int when; /* SCRIPT_Before|Script_After BEFORE/AFTER JOB*/
+ /* TODO : drop this with bacula 1.42 */
+ bool old_proto; /* used by old 1.3X protocol */
int run(JCR *job, const char *name="");
bool can_run_at_level(int JobLevel) { return true;}; /* TODO */
void set_command(const POOLMEM *cmd);
void set_target(const POOLMEM *client_name);
void reset_default(bool free_string = false);
- bool is_local(); /* true if running on local host */
+ bool is_local(); /* true if running on local host */
void debug();
};
/* foreach_alist free RUNSCRIPT */
void free_runscripts(alist *runscripts); /* you have to free alist */
-#endif /* USE_RUNSCRIPT */
-
#endif /* __RUNSCRIPT_H_ */