/*
Bacula® - The Network Backup Solution
- Copyright (C) 2000-2007 Free Software Foundation Europe e.V.
+ Copyright (C) 2000-2010 Free Software Foundation Europe e.V.
The main author of Bacula is Kern Sibbald, with contributions from
many others, a complete list can be found in the file AUTHORS.
This program is Free Software; you can redistribute it and/or
- modify it under the terms of version two of the GNU General Public
+ modify it under the terms of version three of the GNU Affero General Public
License as published by the Free Software Foundation and included
in the file LICENSE.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Affero General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
*/
/*
* Director external function prototypes
- *
- * Version $Id$
*/
/* admin.c */
/* autoprune.c */
extern void do_autoprune(JCR *jcr);
-extern bool prune_volumes(JCR *jcr, bool InChanger, MEDIA_DBR *mr);
+extern void prune_volumes(JCR *jcr, bool InChanger, MEDIA_DBR *mr);
/* autorecycle.c */
extern bool recycle_oldest_purged_volume(JCR *jcr, bool InChanger, MEDIA_DBR *mr);
extern bool do_backup(JCR *jcr);
extern void backup_cleanup(JCR *jcr, int TermCode);
extern void update_bootstrap_file(JCR *jcr);
+extern bool send_accurate_current_files(JCR *jcr);
+
/* vbackup.c */
extern bool do_vbackup_init(JCR *jcr);
/* catreq.c */
extern void catalog_request(JCR *jcr, BSOCK *bs);
extern void catalog_update(JCR *jcr, BSOCK *bs);
+extern bool despool_attributes_from_file(JCR *jcr, const char *file);
/* dird_conf.c */
extern const char *level_to_str(int level);
-extern "C" char *job_code_callback_filesetname(JCR *jcr, const char*);
+extern "C" char *job_code_callback_director(JCR *jcr, const char*);
/* expand.c */
int variable_expansion(JCR *jcr, char *inp, POOLMEM **exp);
int max_retry_time, int verbose);
extern bool send_include_list(JCR *jcr);
extern bool send_exclude_list(JCR *jcr);
-extern bool send_bootstrap_file(JCR *jcr, BSOCK *sock);
extern bool send_level_command(JCR *jcr);
extern int get_attributes_and_put_in_catalog(JCR *jcr);
extern void get_attributes_and_compare_to_catalog(JCR *jcr, JobId_t JobId);
char *link, char *attr, int stream);
extern void get_level_since_time(JCR *jcr, char *since, int since_len);
extern int send_runscripts_commands(JCR *jcr);
+extern bool send_restore_objects(JCR *jcr);
/* getmsg.c */
enum e_prtmsg {
extern void free_rstorage(JCR *jcr);
extern bool setup_job(JCR *jcr);
extern void create_clones(JCR *jcr);
-extern bool create_restore_bootstrap_file(JCR *jcr);
+extern int create_restore_bootstrap_file(JCR *jcr);
extern void dird_free_jcr(JCR *jcr);
extern void dird_free_jcr_pointers(JCR *jcr);
extern void cancel_storage_daemon_job(JCR *jcr);
extern bool run_console_command(JCR *jcr, const char *cmd);
+extern void sd_msg_thread_send_signal(JCR *jcr, int sig);
+
+/* jobq.c */
+extern bool inc_read_store(JCR *jcr);
+extern void dec_read_store(JCR *jcr);
/* migration.c */
extern bool do_migration(JCR *jcr);
/* msgchan.c */
extern bool connect_to_storage_daemon(JCR *jcr, int retry_interval,
int max_retry_time, int verbose);
-extern bool start_storage_daemon_job(JCR *jcr, alist *rstore, alist *wstore);
+extern bool start_storage_daemon_job(JCR *jcr, alist *rstore, alist *wstore,
+ bool send_bsr=false);
extern bool start_storage_daemon_message_thread(JCR *jcr);
extern int bget_dirmsg(BSOCK *bs);
extern void wait_for_storage_daemon_termination(JCR *jcr);
+extern bool send_bootstrap_file(JCR *jcr, BSOCK *sd);
/* next_vol.c */
int find_next_volume_for_append(JCR *jcr, MEDIA_DBR *mr, int index,
bool do_a_command(UAContext *ua);
bool do_a_dot_command(UAContext *ua);
int qmessagescmd(UAContext *ua, const char *cmd);
+bool open_new_client_db(UAContext *ua);
bool open_client_db(UAContext *ua);
bool open_db(UAContext *ua);
void close_db(UAContext *ua);
};
int create_pool(JCR *jcr, B_DB *db, POOL *pool, e_pool_op op);
void set_pool_dbr_defaults_in_media_dbr(MEDIA_DBR *mr, POOL_DBR *pr);
-bool set_pooldbr_recyclepoolid(JCR *jcr, B_DB *db, POOL_DBR *pr, POOL *pool);
+bool set_pooldbr_references(JCR *jcr, B_DB *db, POOL_DBR *pr, POOL *pool);
void set_pooldbr_from_poolres(POOL_DBR *pr, POOL *pool, e_pool_op op);
-int update_pool_recyclepool(JCR *jcr, B_DB *db, POOL *pool);
+int update_pool_references(JCR *jcr, B_DB *db, POOL *pool);
/* ua_input.c */
-int get_cmd(UAContext *ua, const char *prompt);
+int get_cmd(UAContext *ua, const char *prompt, bool subprompt=false);
bool get_pint(UAContext *ua, const char *prompt);
bool get_yesno(UAContext *ua, const char *prompt);
bool is_yesno(char *val, int *ret);
int get_enabled(UAContext *ua, const char *val);
void parse_ua_args(UAContext *ua);
+bool is_comment_legal(UAContext *ua, const char *name);
/* ua_label.c */
bool is_volume_name_legal(UAContext *ua, const char *name);
/* ua_output.c */
void prtit(void *ctx, const char *msg);
bool complete_jcr_for_job(JCR *jcr, JOB *job, POOL *pool);
-RUN *find_next_run(RUN *run, JOB *job, time_t &runtime, int ndays);
+RUN *find_next_run(RUN *run, JOB *job, utime_t &runtime, int ndays);
/* ua_restore.c */
-int get_next_jobid_from_list(char **p, JobId_t *JobId);
void find_storage_resource(UAContext *ua, RESTORE_CTX &rx, char *Storage, char *MediaType);
/* ua_server.c */
/* ua_select.c */
STORE *select_storage_resource(UAContext *ua);
JOB *select_job_resource(UAContext *ua);
+JOB *select_enable_disable_job_resource(UAContext *ua, bool enable);
JOB *select_restore_job_resource(UAContext *ua);
CLIENT *select_client_resource(UAContext *ua);
FILESET *select_fileset_resource(UAContext *ua);
bool get_pool_dbr(UAContext *ua, POOL_DBR *pr, const char *argk="pool");
bool get_client_dbr(UAContext *ua, CLIENT_DBR *cr);
POOL *get_pool_resource(UAContext *ua);
+JOB *get_restore_job(UAContext *ua);
POOL *select_pool_resource(UAContext *ua);
+JCR *select_running_job(UAContext *ua, const char *reason);
CLIENT *get_client_resource(UAContext *ua);
int get_job_dbr(UAContext *ua, JOB_DBR *jr);
int insert_tree_handler(void *ctx, int num_fields, char **row);
/* ua_prune.c */
-int prune_files(UAContext *ua, CLIENT *client);
-int prune_jobs(UAContext *ua, CLIENT *client, int JobType);
+int prune_files(UAContext *ua, CLIENT *client, POOL *pool);
+int prune_jobs(UAContext *ua, CLIENT *client, POOL *pool, int JobType);
int prune_stats(UAContext *ua, utime_t retention);
bool prune_volume(UAContext *ua, MEDIA_DBR *mr);
int job_delete_handler(void *ctx, int num_fields, char **row);
int del_count_handler(void *ctx, int num_fields, char **row);
int file_delete_handler(void *ctx, int num_fields, char **row);
int get_prune_list_for_volume(UAContext *ua, MEDIA_DBR *mr, del_ctx *del);
+int exclude_running_jobs_from_list(del_ctx *prune_list);
/* ua_purge.c */
-bool is_volume_purged(UAContext *ua, MEDIA_DBR *mr);
+bool is_volume_purged(UAContext *ua, MEDIA_DBR *mr, bool force=false);
bool mark_media_purged(UAContext *ua, MEDIA_DBR *mr);
-void purge_files_from_volume(UAContext *ua, MEDIA_DBR *mr );
-bool purge_jobs_from_volume(UAContext *ua, MEDIA_DBR *mr);
+void purge_files_from_volume(UAContext *ua, MEDIA_DBR *mr);
+bool purge_jobs_from_volume(UAContext *ua, MEDIA_DBR *mr, bool force=false);
void purge_files_from_jobs(UAContext *ua, char *jobs);
void purge_jobs_from_catalog(UAContext *ua, char *jobs);
void purge_job_list_from_catalog(UAContext *ua, del_ctx &del);