From 900f5efe5dc3eded1d6e8f7f01aba39db7c3d377 Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Tue, 17 Jun 2008 21:22:10 +0000 Subject: [PATCH] Backup config support --- servers/CHANGELOG | 2 ++ servers/backup_config.pl | 41 ++++++++++++++++++++++++++++++++++++++++ servers/servers-lib.pl | 1 + 3 files changed, 44 insertions(+) create mode 100644 servers/backup_config.pl diff --git a/servers/CHANGELOG b/servers/CHANGELOG index 9c1541036..ae3fbb674 100644 --- a/servers/CHANGELOG +++ b/servers/CHANGELOG @@ -13,3 +13,5 @@ Made the auto-registration email contents translatable. Fixed return link when using a framed theme. ---- Changes since 1.320 ---- Added several new operating systems and distributions to the server type list. +---- Changes since 1.420 ---- +Allow the Backup Configuration Files module to save and restore Webmin server details. diff --git a/servers/backup_config.pl b/servers/backup_config.pl new file mode 100644 index 000000000..b6f89dca1 --- /dev/null +++ b/servers/backup_config.pl @@ -0,0 +1,41 @@ + +do 'servers-lib.pl'; + +# backup_config_files() +# Returns files and directories that can be backed up +sub backup_config_files +{ +local @rv = map { $_->{'file'} } &list_servers(); +return @rv; +} + +# pre_backup(&files) +# Called before the files are actually read +sub pre_backup +{ +return undef; +} + +# post_backup(&files) +# Called after the files are actually read +sub post_backup +{ +return undef; +} + +# pre_restore(&files) +# Called before the files are restored from a backup +sub pre_restore +{ +return undef; +} + +# post_restore(&files) +# Called after the files are restored from a backup +sub post_restore +{ +return undef; +} + +1; + diff --git a/servers/servers-lib.pl b/servers/servers-lib.pl index 9d3f934cd..9db539d4c 100644 --- a/servers/servers-lib.pl +++ b/servers/servers-lib.pl @@ -56,6 +56,7 @@ sub get_server local $serv; $serv->{'id'} = $_[0]; &read_file("$module_config_directory/$_[0].serv", $serv) || return undef; +$serv->{'file'} = "$module_config_directory/$_[0].serv"; return $serv; }