MythTV  0.26-pre
Functions | Variables
mythconverg_restore.pl File Reference

Go to the source code of this file.

Functions

 our ($username, $homedir, $mythconfdir, $database_information_file)
 our ($partial_restore, $with_plugin_data, $restore_xmltvids)
 our ($usage, $debug, $show_version, $show_version_script, $dbh)
 our ($backup_directory, $backup_filename)
 GetOptions ('hostname|DBHostName=s'=>\$db_hostname, 'port|DBPort=i'=>\$db_port, 'username|DBUserName=s'=>\$db_username,#This script does not accept a database password on the command-line.# 'password|DBPassword=s'=>\$db_password, 'name|DBName=s'=>\$db_name, 'schemaver|DBSchemaVer=s'=>\$db_schema_version, 'directory|DBBackupDirectory=s'=>\$backup_directory, 'filename|DBBackupFilename=s'=>\$backup_filename, 'partial_restore|new_hardware|'. 'partial-restore|new-hardware'=>\$partial_restore, 'with_plugin_data|plugin_data|'. 'with-plugin-data|plugin-data'=>\$with_plugin_data, 'restore_xmltvids|'. 'restore-xmltvids|xmltvids'=>\$restore_xmltvids, 'mysql_client|mysql-client|client=s'=>\$mysql_client, 'uncompress=s'=>\$uncompress, 'drop_database|drop_db|'. 'drop-database|drop-db'=>\$drop_database, 'create_database|create_db|mc_sql|'. 'create-database|create-db|mc-sql'=>\$create_database, 'change_hostname|change-hostname'=>\$change_hostname, 'new_hostname|new-hostname=s'=>\$new_hostname, 'old_hostname|old-hostname=s'=>\$old_hostname, 'usage|help|h+'=>\$usage, 'version'=>\$show_version, 'script_version|script-version|v'=>\$show_version_script, 'verbose|debug|d+'=>\$debug)
 verbose ($verbose_level_debug," - checking: $file")
return unless ($file &&-e $file)
 verbose ($verbose_level_debug," parsing: $file")
 open (CONF, $file) or die("\nERROR
 elsif (!-d $backup_conf{'directory'})
 if (!$backup_conf{'filename'})
 if (check_database)
$dbh disconnect if (defined($dbh))

Variables

use File::Temp qw tempfile
 $NAME = 'MythTV Database Restore Script'
 $VERSION = '1.0.18'
our mysql_conf
our backup_conf
 $verbose_level_always = 0
 $verbose_level_debug = 1
 $verbose_level_error = 255
 $d_db_name = 'mythconverg'
 $d_mysql_client = 'mysql'
 $d_uncompress = 'gzip -d'
 $mysql_client = $d_mysql_client
 $uncompress = $d_uncompress
 $debug = 0
 $new_hostname = ''
 $old_hostname = ''
 $partial_restore = $restore_xmltvids
print $fh[client] npassword
print $fh[client] stopped
if it exists
if it should be a database $database_information_file = shift
 configure_environment
 read_config
 check_config
 print_configuration
my $status = 1

Function Documentation

our ( username,
homedir,
mythconfdir,
database_information_file 
)
our ( partial_restore,
with_plugin_data,
restore_xmltvids 
)
our ( usage,
debug,
show_version,
show_version_script,
dbh 
)
our ( backup_directory,
backup_filename 
)
GetOptions ( 'hostname|  DBHostName = s'=,
\$  db_hostname,
'port|  DBPort = i'=,
\$  db_port,
'username|  DBUserName = s'=,
\$  db_username,
#This script does not accept a database password on the command-line.# 'password|  DBPassword = s'=,
\$  db_password,
'name DBName = s'=,
\$  db_name,
'schemaver|  DBSchemaVer = s'=,
\$  db_schema_version,
'directory|  DBBackupDirectory = s'=,
\$  backup_directory,
'filename|  DBBackupFilename = s'=,
\$  backup_filename,
'partial_restore|new_hardware|'. 'partial-restore|new-hardware'  ,
\$  partial_restore,
'with_plugin_data|plugin_data|'. 'with-plugin-data|plugin-data ,
\$  with_plugin_data,
'restore_xmltvids|'. 'restore-xmltvids|xmltvids'  ,
\$  restore_xmltvids,
'mysql_client|mysql-client|  client = s'=,
\$  mysql_client,
uncompress = s'=,
\$  uncompress,
'drop_database|drop_db|'. 'drop-database|drop-db'  ,
\$  drop_database,
'create_database|create_db|mc_sql|'. 'create-database|create-db|mc-sql'  ,
\$  create_database,
'change_hostname|change-hostname'  ,
\$  change_hostname,
'new_hostname|new-  hostname = s'=,
\$  new_hostname,
'old_hostname|old-  hostname = s'=,
\$  old_hostname,
'usage|help|h+'  ,
\$  usage,
'version'  ,
\$  show_version,
'script_version|script-version|v'  ,
\$  show_version_script,
'verbose|debug|d+'  ,
\$  debug 
)
verbose ( verbose_level_debug,
" - checking: $file"   
)
return unless ( $file &&-e $  file)
verbose ( verbose_level_debug,
" parsing: $file"   
)
open ( CONF  ,
file 
)

Definition at line 549 of file mythconverg_restore.pl.

elsif ( )

Definition at line 780 of file mythconverg_restore.pl.

if ( )

Definition at line 793 of file mythconverg_restore.pl.

if ( check_database  )

Definition at line 1747 of file mythconverg_restore.pl.

$dbh disconnect if ( defined($dbh)  )

Variable Documentation

use File::Temp qw tempfile

Definition at line 12 of file mythconverg_restore.pl.

$NAME = 'MythTV Database Restore Script'

Definition at line 15 of file mythconverg_restore.pl.

$VERSION = '1.0.18'

Definition at line 16 of file mythconverg_restore.pl.

Initial value:
 ('db_host'       => '',
                        'db_port'       => -1,
                        'db_user'       => '',
                        'db_pass'       => '',
                        'db_name'       => '',
                        'db_schemaver'  => ''
                        )

Definition at line 32 of file mythconverg_restore.pl.

Initial value:
 ('directory'     => '',
                        'filename'      => ''
                       )

Definition at line 39 of file mythconverg_restore.pl.

$verbose_level_always = 0

Definition at line 44 of file mythconverg_restore.pl.

$verbose_level_debug = 1

Definition at line 45 of file mythconverg_restore.pl.

$verbose_level_error = 255

Definition at line 46 of file mythconverg_restore.pl.

$d_db_name = 'mythconverg'

Definition at line 49 of file mythconverg_restore.pl.

$d_mysql_client = 'mysql'

Definition at line 50 of file mythconverg_restore.pl.

$d_uncompress = 'gzip -d'

Definition at line 51 of file mythconverg_restore.pl.

$mysql_client = $d_mysql_client

Definition at line 54 of file mythconverg_restore.pl.

Referenced by open().

$uncompress = $d_uncompress

Definition at line 55 of file mythconverg_restore.pl.

Referenced by open().

$debug = 0

Definition at line 56 of file mythconverg_restore.pl.

$new_hostname = ''

Definition at line 57 of file mythconverg_restore.pl.

$old_hostname = ''

Definition at line 58 of file mythconverg_restore.pl.

$partial_restore = $restore_xmltvids

Definition at line 91 of file mythconverg_restore.pl.

Referenced by open().

print $fh [client] npassword
Initial value:
"))
            {
                print_configuration;
                die("\nERROR: DBBackupDirectory not specified

Definition at line 761 of file mythconverg_restore.pl.

print $fh [client] stopped

Definition at line 761 of file mythconverg_restore.pl.

if it exists

Definition at line 1220 of file mythconverg_restore.pl.

if it should be a database $database_information_file = shift

Definition at line 1738 of file mythconverg_restore.pl.

Definition at line 1740 of file mythconverg_restore.pl.

Definition at line 1741 of file mythconverg_restore.pl.

Definition at line 1742 of file mythconverg_restore.pl.

Definition at line 1744 of file mythconverg_restore.pl.

exit $status = 1

Definition at line 1746 of file mythconverg_restore.pl.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends