/*
Bacula(R) - The Network Backup Solution
- Copyright (C) 2000-2015 Kern Sibbald
- Copyright (C) 2000-2014 Free Software Foundation Europe e.V.
+ Copyright (C) 2000-2017 Kern Sibbald
The original author of Bacula is Kern Sibbald, with contributions
from many others, a complete list can be found in the file AUTHORS.
Public License, v3.0 ("AGPLv3") and some additional permissions and
terms pursuant to its AGPLv3 Section 7.
- This notice must be preserved when any source code is
+ This notice must be preserved when any source code is
conveyed and/or propagated.
Bacula(R) is a registered trademark of Kern Sibbald.
#define JT_MIGRATE 'g' /* Migration Job */
#define JT_SCAN 'S' /* Scan Job */
+/* Used to handle ClientAcl in various commands, not stored in the DB */
+#define JT_BACKUP_RESTORE '*' /* Backup or Restore Job */
+
/* Job Status. Some of these are stored in the DB */
#define JS_Canceled 'A' /* canceled by user */
#define JS_Blocked 'B' /* blocked */
#define JS_WaitDevice 'q' /* Queued waiting for device */
#define JS_WaitStoreRes 's' /* Waiting for storage resource */
#define JS_WaitStartTime 't' /* Waiting for start time */
+#define JS_CloudUpload 'u' /* Cloud upload */
+#define JS_CloudDownload 'w' /* Cloud download */
-
-/* Migration selection types */
+/* Migration selection types. Do not change the order. */
enum {
MT_SMALLEST_VOL = 1,
MT_OLDEST_VOL,
#define job_waiting(jcr) \
(jcr->job_started && \
- (jcr->JobStatus == JS_WaitFD || \
- jcr->JobStatus == JS_WaitSD || \
- jcr->JobStatus == JS_WaitMedia || \
- jcr->JobStatus == JS_WaitMount || \
- jcr->JobStatus == JS_WaitStoreRes || \
- jcr->JobStatus == JS_WaitJobRes || \
- jcr->JobStatus == JS_WaitClientRes|| \
- jcr->JobStatus == JS_WaitMaxJobs || \
- jcr->JobStatus == JS_WaitPriority || \
- jcr->SDJobStatus == JS_WaitMedia || \
- jcr->SDJobStatus == JS_WaitMount || \
- jcr->SDJobStatus == JS_WaitDevice || \
+ (jcr->JobStatus == JS_WaitFD || \
+ jcr->JobStatus == JS_WaitSD || \
+ jcr->JobStatus == JS_WaitMedia || \
+ jcr->JobStatus == JS_WaitMount || \
+ jcr->JobStatus == JS_WaitStoreRes || \
+ jcr->JobStatus == JS_WaitJobRes || \
+ jcr->JobStatus == JS_WaitClientRes || \
+ jcr->JobStatus == JS_WaitMaxJobs || \
+ jcr->JobStatus == JS_WaitPriority || \
+ jcr->SDJobStatus == JS_WaitMedia || \
+ jcr->SDJobStatus == JS_WaitMount || \
+ jcr->SDJobStatus == JS_WaitDevice || \
+ jcr->SDJobStatus == JS_CloudUpload || \
+ jcr->SDJobStatus == JS_CloudDownload || \
jcr->SDJobStatus == JS_WaitMaxJobs))
#ifdef FILE_DAEMON
+class VSSClient;
class htable;
-struct acl_ctx_t;
-struct xattr_ctx_t;
+class BACL;
+class BXATTR;
class snapshot_manager;
struct CRYPTO_CTX {
pthread_mutex_destroy(&mutex_auth);
pthread_mutex_destroy(&mutex);
};
+ bool is_internal_job() {return (JobId == 0 || m_JobType == JT_SYSTEM || m_JobType == JT_CONSOLE); };
bool is_job_canceled() {return job_canceled(this); };
bool is_canceled() {return job_canceled(this); };
bool is_incomplete() { return JobStatus == JS_Incomplete; };
bool no_client_used() const {
return (m_JobLevel == L_VIRTUAL_FULL);
};
+ bool can_be_stopped(); /* in lib/jcr.c */
const char *get_OperationName(); /* in lib/jcr.c */
const char *get_ActionName(bool past); /* in lib/jcr.c */
void setJobStatus(int JobStatus); /* in lib/jcr.c */
POOLMEM *comment; /* Comment for this Job */
int64_t max_bandwidth; /* Bandwidth limit for this Job */
htable *path_list; /* Directory list (used by findlib) */
-
+ int job_uid; /* UID used during job session */
+ char *job_user; /* Specific permission for a job */
+ char *job_group; /* Specific permission for a job */
+ POOLMEM *StatusErrMsg; /* Error message displayed in the job report */
uint32_t getErrors() { return JobErrors + SDErrors; }; /* Get error count */
/* Daemon specific part of JCR */
POOLMEM *wstore_source; /* Where write storage came from */
POOLMEM *catalog_source; /* Where catalog came from */
POOLMEM *next_vol_list; /* Volumes previously requested */
- uint32_t replace; /* Replace option */
+ int32_t replace; /* Replace option */
int32_t NumVols; /* Number of Volume used in pool */
int32_t reschedule_count; /* Number of times rescheduled */
int32_t FDVersion; /* File daemon version number */
bool RescheduleIncompleteJobs; /* set if incomplete can be rescheduled */
bool use_all_JobIds; /* Use all jobids present in command line */
bool sd_client; /* This job runs as SD client */
+ bool dummy_jobmedia; /* Dummy JobMedia written */
#endif /* DIRECTOR_DAEMON */
POOLMEM *last_fname; /* last file saved/verified */
POOLMEM *job_metadata; /* VSS job metadata */
pthread_cond_t job_start_wait; /* Wait for SD to start Job */
- acl_ctx_t *acl_ctx; /* ACLs for backup/restore */
- xattr_ctx_t *xattr_ctx; /* Extended Attributes for backup/restore */
+ BACL *bacl; /* ACLs for backup/restore */
+ BXATTR *bxattr; /* Extended Attributes for backup/restore */
int32_t last_type; /* type of last file saved/verified */
int incremental; /* set if incremental for SINCE */
time_t last_stat_time; /* Last time stats sent to Dir */
uint64_t base_size; /* compute space saved with base job */
utime_t snapshot_retention; /* Snapshot retention (from director) */
snapshot_manager *snap_mgr; /* Snapshot manager */
+ VSSClient *pVSSClient; /* VSS handler */
#endif /* FILE_DAEMON */
bool Resched; /* Job may be rescheduled */
bool bscan_insert_jobmedia_records; /*Bscan: needs to insert job media records */
bool sd_client; /* Set if acting as client */
+ bool use_new_match_all; /* TODO: Remove when the match_bsr() will be well tested */
/* Parmaters for Open Read Session */
BSR *bsr; /* Bootstrap record -- has everything */