2004-03-26 15:25:15 +03:00
/*
2004-03-30 23:35:44 +04:00
* Copyright ( C ) 2001 - 2004 Sistina Software , Inc . All rights reserved .
2007-07-18 19:38:58 +04:00
* Copyright ( C ) 2004 - 2007 Red Hat , Inc . All rights reserved .
2004-03-26 15:25:15 +03:00
*
2004-03-30 23:35:44 +04:00
* This file is part of LVM2 .
*
* This copyrighted material is made available to anyone wishing to use ,
* modify , copy , or redistribute it subject to the terms and conditions
2007-08-21 00:55:30 +04:00
* of the GNU Lesser General Public License v .2 .1 .
2004-03-30 23:35:44 +04:00
*
2007-08-21 00:55:30 +04:00
* You should have received a copy of the GNU Lesser General Public License
2004-03-30 23:35:44 +04:00
* along with this program ; if not , write to the Free Software Foundation ,
* Inc . , 59 Temple Place , Suite 330 , Boston , MA 02111 - 1307 USA
2004-03-26 15:25:15 +03:00
*/
# ifndef _LVM_TOOL_ARCHIVE_H
# define _LVM_TOOL_ARCHIVE_H
2007-07-18 19:38:58 +04:00
# include "metadata-exported.h"
2004-03-26 15:25:15 +03:00
/*
* There are two operations that come under the general area of
* backups . ' Archiving ' occurs just before a volume group
* configuration is changed . The user may configure when
* archived files are expired . Typically archives will be stored
* in / etc / lvm / archive .
*
* A ' backup ' is a redundant copy of the * current * volume group
* configuration . As such it should be taken just after the
* volume group is changed . Only 1 backup file will exist .
* Typically backups will be stored in / etc / lvm / backups .
*/
2005-05-17 17:46:38 +04:00
int archive_init ( struct cmd_context * cmd , const char * dir ,
2008-12-11 06:32:56 +03:00
unsigned int keep_days , unsigned int keep_min ,
int enabled ) ;
2005-05-17 17:46:38 +04:00
void archive_exit ( struct cmd_context * cmd ) ;
2004-03-26 15:25:15 +03:00
2005-05-17 17:46:38 +04:00
void archive_enable ( struct cmd_context * cmd , int flag ) ;
2004-03-26 15:25:15 +03:00
int archive ( struct volume_group * vg ) ;
int archive_display ( struct cmd_context * cmd , const char * vg_name ) ;
2007-06-09 02:38:48 +04:00
int archive_display_file ( struct cmd_context * cmd , const char * file ) ;
2004-03-26 15:25:15 +03:00
2008-12-11 06:33:35 +03:00
int backup_init ( struct cmd_context * cmd , const char * dir , int enabled ) ;
2005-05-17 17:46:38 +04:00
void backup_exit ( struct cmd_context * cmd ) ;
2004-03-26 15:25:15 +03:00
2005-05-17 17:46:38 +04:00
void backup_enable ( struct cmd_context * cmd , int flag ) ;
2004-03-26 15:25:15 +03:00
int backup ( struct volume_group * vg ) ;
2009-04-22 13:39:45 +04:00
int backup_locally ( struct volume_group * vg ) ;
2005-05-17 17:46:38 +04:00
int backup_remove ( struct cmd_context * cmd , const char * vg_name ) ;
2004-03-26 15:25:15 +03:00
struct volume_group * backup_read_vg ( struct cmd_context * cmd ,
const char * vg_name , const char * file ) ;
int backup_restore_vg ( struct cmd_context * cmd , struct volume_group * vg ) ;
int backup_restore_from_file ( struct cmd_context * cmd , const char * vg_name ,
const char * file ) ;
int backup_restore ( struct cmd_context * cmd , const char * vg_name ) ;
int backup_to_file ( const char * file , const char * desc , struct volume_group * vg ) ;
2005-05-17 17:44:02 +04:00
void check_current_backup ( struct volume_group * vg ) ;
2004-03-26 15:25:15 +03:00
# endif