1/*	$NetBSD: archiver.h,v 1.1.1.3 2009/12/02 00:25:44 haad Exp $	*/
2
3/*
4 * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
5 * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
6 *
7 * This file is part of LVM2.
8 *
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.
12 *
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
16 */
17
18#ifndef _LVM_TOOL_ARCHIVE_H
19#define _LVM_TOOL_ARCHIVE_H
20
21#include "metadata-exported.h"
22
23/*
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.
29 *
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.
34 */
35
36int archive_init(struct cmd_context *cmd, const char *dir,
37		 unsigned int keep_days, unsigned int keep_min,
38		 int enabled);
39void archive_exit(struct cmd_context *cmd);
40
41void archive_enable(struct cmd_context *cmd, int flag);
42int archive(struct volume_group *vg);
43int archive_display(struct cmd_context *cmd, const char *vg_name);
44int archive_display_file(struct cmd_context *cmd, const char *file);
45
46int backup_init(struct cmd_context *cmd, const char *dir, int enabled);
47void backup_exit(struct cmd_context *cmd);
48
49void backup_enable(struct cmd_context *cmd, int flag);
50int backup(struct volume_group *vg);
51int backup_locally(struct volume_group *vg);
52int backup_remove(struct cmd_context *cmd, const char *vg_name);
53
54struct volume_group *backup_read_vg(struct cmd_context *cmd,
55				    const char *vg_name, const char *file);
56int backup_restore_vg(struct cmd_context *cmd, struct volume_group *vg);
57int backup_restore_from_file(struct cmd_context *cmd, const char *vg_name,
58			     const char *file);
59int backup_restore(struct cmd_context *cmd, const char *vg_name);
60
61int backup_to_file(const char *file, const char *desc, struct volume_group *vg);
62
63void check_current_backup(struct volume_group *vg);
64
65#endif
66