4 * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
5 * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
7 * This file is part of LVM2.
9 * This copyrighted material is made available to anyone wishing to use,
10 * modify, copy, or redistribute it subject to the terms and conditions
11 * of the GNU Lesser General Public License v.2.1.
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program; if not, write to the Free Software Foundation,
15 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 #ifndef _LVM_TOOL_ARCHIVE_H
19 #define _LVM_TOOL_ARCHIVE_H
21 #include "metadata-exported.h"
24 * There are two operations that come under the general area of
25 * backups. 'Archiving' occurs just before a volume group
26 * configuration is changed. The user may configure when
27 * archived files are expired. Typically archives will be stored
28 * in /etc/lvm/archive.
30 * A 'backup' is a redundant copy of the *current* volume group
31 * configuration. As such it should be taken just after the
32 * volume group is changed. Only 1 backup file will exist.
33 * Typically backups will be stored in /etc/lvm/backups.
36 int archive_init(struct cmd_context
*cmd
, const char *dir
,
37 unsigned int keep_days
, unsigned int keep_min
,
39 void archive_exit(struct cmd_context
*cmd
);
41 void archive_enable(struct cmd_context
*cmd
, int flag
);
42 int archive(struct volume_group
*vg
);
43 int archive_display(struct cmd_context
*cmd
, const char *vg_name
);
44 int archive_display_file(struct cmd_context
*cmd
, const char *file
);
46 int backup_init(struct cmd_context
*cmd
, const char *dir
, int enabled
);
47 void backup_exit(struct cmd_context
*cmd
);
49 void backup_enable(struct cmd_context
*cmd
, int flag
);
50 int backup(struct volume_group
*vg
);
51 int backup_locally(struct volume_group
*vg
);
52 int backup_remove(struct cmd_context
*cmd
, const char *vg_name
);
54 struct volume_group
*backup_read_vg(struct cmd_context
*cmd
,
55 const char *vg_name
, const char *file
);
56 int backup_restore_vg(struct cmd_context
*cmd
, struct volume_group
*vg
);
57 int backup_restore_from_file(struct cmd_context
*cmd
, const char *vg_name
,
59 int backup_restore(struct cmd_context
*cmd
, const char *vg_name
);
61 int backup_to_file(const char *file
, const char *desc
, struct volume_group
*vg
);
63 void check_current_backup(struct volume_group
*vg
);