]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/filed/fd_snapshot.h
5d670deb50f9678e2936c309f71d03c3fdcf80c4
[bacula/bacula] / bacula / src / filed / fd_snapshot.h
1 /*
2    Bacula(R) - The Network Backup Solution
3
4    Copyright (C) 2000-2015 Kern Sibbald
5    Copyright (C) 2000-2014 Free Software Foundation Europe e.V.
6
7    The original author of Bacula is Kern Sibbald, with contributions
8    from many others, a complete list can be found in the file AUTHORS.
9
10    You may use this file and others of this release according to the
11    license defined in the LICENSE file, which includes the Affero General
12    Public License, v3.0 ("AGPLv3") and some additional permissions and
13    terms pursuant to its AGPLv3 Section 7.
14
15    This notice must be preserved when any source code is 
16    conveyed and/or propagated.
17
18    Bacula(R) is a registered trademark of Kern Sibbald.
19
20    Written by Eric Bollengier 2015
21 */
22
23 #ifndef FD_SNAPSHOT_H
24 #define FD_SNAPSHOT_H
25
26 /* default snapshot handler */
27 char *snapshot_get_command();
28
29 /* Internal objects */
30 class mtab;                     /* device list */
31 class fs_device;
32
33 class snapshot_manager: public SMARTALLOC
34 {
35 private:
36    JCR  *jcr;
37 public:
38    mtab *mount_list;
39
40    snapshot_manager(JCR *ajcr);
41    virtual ~snapshot_manager();
42
43    /* Quiesce application and take snapshot */
44    bool create_snapshots();
45    
46    /* Cleanup snapshots */
47    bool cleanup_snapshots();
48
49    /* List snapshots */
50    bool list_snapshots(alist *ret);
51
52    /* Scan the fileset for devices and application */
53    bool scan_fileset();
54
55    /* Scan the mtab */
56    bool scan_mtab();
57
58    /* Add a mount point to the mtab list */
59    void add_mount_point(uint32_t dev, const char *device, 
60                         const char *mountpoint, const char *fstype);
61 };
62
63 void close_snapshot_backup_session(JCR *jcr);
64 bool open_snapshot_backup_session(JCR *jcr);
65
66 bool snapshot_convert_path(JCR *jcr, FF_PKT *ff, dlist *filelist, dlistString *node);
67
68 #endif  /* FD_SNAPSHOT_H */