MythTV  0.27pre
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
Functions | Variables
mythconverg_backup.pl File Reference

Go to the source code of this file.

Functions

 our ($username, $homedir, $mythconfdir, $database_information_file)
 our ($mysqldump, $compress, $rotate, $rotateglob, $backup_xmltvids)
 our ($backup_directory, $backup_filename)
 our ($verbose_level_always, $verbose_level_debug, $verbose_level_error)
 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, 'mysqldump=s'=>\$mysqldump, 'compress=s'=>\$compress, 'rotate=i'=>\$rotate, 'rotateglob|glob=s'=>\$rotateglob, 'backup_xmltvids|backup-xmltvids|'. 'xmltvids'=>\$backup_xmltvids, 'usage|help|h+'=>\$usage, 'version'=>\$show_version, 'script_version|script-version|v'=>\$show_version_script, 'verbose|debug|d+'=>\$debug)
sub print_version_information my rindex ($0, '/')+1
 if ($show_version_script)
 elsif ($show_version)
 verbose ($verbose_level_debug," - checking: $file")
return unless ($file &&-e $file)
 verbose ($verbose_level_debug," parsing: $file")
 open (CONF, $file) or die("\nERROR
 if ((!-d $backup_conf{'directory'})||(!-w $backup_conf{'directory'}))
 if (!$backup_conf{'filename'})
return if (!$debug)

Variables

use File::Temp qw tempfile
 $NAME = 'MythTV Database Backup Script'
 $VERSION = '1.0.11'
our mysql_conf
our backup_conf
our $is_env_tainted = 1
our $old_env_path = $ENV{"PATH"}
our d_allowed_paths
our allowed_paths
 $verbose_level_always = 0
 $verbose_level_debug = 1
 $verbose_level_error = 255
 $d_db_name = 'mythconverg'
 $d_mysqldump = 'mysqldump'
 $d_compress = 'gzip'
 $d_rotate = 5
 $d_rotateglob = $d_db_name.'-????-??????????????.sql*'
 $mysqldump = $d_mysqldump
 $compress = $d_compress
 $rotate = $d_rotate
 $rotateglob = $d_rotateglob
 $debug = 0
sub print_version_information my $script_name = substr $0
print $NAME n $script_name nversion
 __pad0__
 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 (   $mysqldump,
  $compress,
  $rotate,
  $rotateglob,
  $backup_xmltvids 
)
our (   $backup_directory,
  $backup_filename 
)
our (   $verbose_level_always,
  $verbose_level_debug,
  $verbose_level_error 
)
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,
mysqldump = s'=,
$mysqldump,
compress = s'=,
$compress,
rotate = i'=,
$rotate,
'rotateglob|  glob = s'=,
$rotateglob,
'backup_xmltvids|backup-xmltvids|'. 'xmltvids'  ,
$backup_xmltvids,
'usage|help|h+'  ,
$usage,
'version'  ,
$show_version,
'script_version|script-version|v'  ,
$show_version_script,
'verbose|debug|d+'  ,
$debug 
)
sub print_version_information my rindex (   $0,
'/'   
)
if (   $show_version_script)

Definition at line 101 of file mythconverg_backup.pl.

elsif (   $show_version)

Definition at line 106 of file mythconverg_backup.pl.

verbose (   $verbose_level_debug,
" - checking: $file"   
)
return unless (   $file &&-e)

Definition at line 50 of file channel_icons.pl.

verbose (   $verbose_level_debug,
" parsing: $file"   
)
open ( CONF  ,
  $file 
)

Definition at line 477 of file mythconverg_backup.pl.

Referenced by hardwareprofile.fs_util::__cache_mtab__(), hardwareprofile.uuiddb._UuidDb::_flush(), hardwareprofile.distros.mythtv_data.uuiddb._UuidDb::_flush(), hardwareprofile.devicelist::cat(), cc_open(), MediaMonitorUnix::CheckMountable(), cCiHandler::CreateCiHandler(), createTempFile(), DVBStreamHandler::CycleFiltersByPriority(), hardwareprofile.hwdata.DeviceMap::device_map(), hardwareprofile.os_detect.OSWithFile::do_test(), DVBCam::DVBCam(), DVDOpen(), ProfileGroupEditor::exec(), FIFOWriter::FIFOWriteThread(), FileLogger::FileLogger(), VideoDevice::fillSelectionsFromDir(), VBIDevice::fillSelectionsFromDir(), MythSystemUnix::Fork(), mythburn::generateProjectXCutlist(), mythburn::getCPUCount(), AudioOutputOSS::GetOutputSettings(), if(), JoystickMenuThread::Init(), ZMServer::initMonitor(), mythburn::isMediaAVIFile(), main(), hardwareprofile.MultipartPostHandler::main(), mythburn::main(), NuppelVideoRecorder::MJPEGInit(), mythfile_open(), DVBPIDInfo::Open(), AudioInputOSS::Open(), ImportRecorder::Open(), V4LChannel::Open(), ThreadedFileWriter::Open(), ASIStreamHandler::Open(), MSocketDevice::open(), DVBChannel::Open(), NuppelVideoRecorder::Open(), MainServer::OpenAndUnlink(), AudioOutputOSS::OpenDevice(), MythMediaDevice::openDevice(), FileRingBuffer::OpenFile(), MpegRecorder::OpenMpegFileAsInput(), MpegRecorder::OpenV4L2DeviceAsInput(), V4LRecorder::OpenVBIDevice(), V4LConfigurationGroup::probeCard(), MPEGConfigurationGroup::probeCard(), HDPVRConfigurationGroup::probeCard(), CardUtil::ProbeDVBFrontendName(), CardUtil::ProbeDVBType(), CardUtil::ProbeV4LAudioInputs(), CardUtil::ProbeV4LVideoInputs(), hardwareprofile.distros.mythtv_data.data_mythtv._Mythtv_data::ProcessAudio(), mythburn::processJob(), DeleteThread::ProcessNew(), hardwareprofile.distros.mythtv_data.data_mythtv._Mythtv_data::ProcessSmoltInfo(), hardwareprofile.smolt::read_cpuinfo(), hardwareprofile.smolt::read_memory_2_4(), hardwareprofile.smolt::read_memory_2_6(), MSqlDatabase::Reconnect(), FileLogger::reopen(), MpegRecorder::run(), DVBStreamHandler::RunTS(), MythCDROMDarwin::setDeviceSpeed(), MythCDROMLinux::setDeviceSpeed(), MPEG2replex::Start(), MpegRecorder::StartEncoding(), DVBStreamHandler::SupportsTSMonitoring(), DRMVideoSync::TryInit(), RTCVideoSync::TryInit(), hardwareprofile.os_detect.get_os_info::ubuntu(), nv_python_libs.pbs.pbs_api.Videos::updatePBS(), nv_python_libs.rev3.rev3_api.Videos::updateRev3(), nv_python_libs.tedtalks.tedtalks_api.Videos::updateTedTalks(), nv_python_libs.thewb.thewb_api.Videos::updateTheWB(), vbi_open(), AudioOutputOSS::VolumeInit(), MPEG2fixup::WriteData(), mythburn::WriteXMLToFile(), and MPEG2fixup::WriteYUV().

if ( (!-d $backup_conf{'directory'})||(!-w $backup_conf{'directory'})  )

Definition at line 858 of file mythconverg_backup.pl.

if ( )

Definition at line 872 of file mythconverg_backup.pl.

return if ( $debug)

Definition at line 139 of file metoffice_fivedayapi.pl.

Variable Documentation

use File::Temp qw tempfile

Definition at line 12 of file mythconverg_backup.pl.

$NAME = 'MythTV Database Backup Script'

Definition at line 15 of file mythconverg_backup.pl.

$VERSION = '1.0.11'

Definition at line 16 of file mythconverg_backup.pl.

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

Definition at line 30 of file mythconverg_backup.pl.

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

Definition at line 37 of file mythconverg_backup.pl.

our $is_env_tainted = 1

Definition at line 42 of file mythconverg_backup.pl.

our $old_env_path = $ENV{"PATH"}

Definition at line 43 of file mythconverg_backup.pl.

our d_allowed_paths
Initial value:
("/bin",
"/usr/bin",
"/usr/local/bin",
"/sbin",
"/usr/sbin",
"/usr/local/sbin"
)

Definition at line 44 of file mythconverg_backup.pl.

our allowed_paths

Definition at line 51 of file mythconverg_backup.pl.

$verbose_level_always = 0

Definition at line 54 of file mythconverg_backup.pl.

Referenced by if().

$verbose_level_debug = 1

Definition at line 55 of file mythconverg_backup.pl.

$verbose_level_error = 255

Definition at line 56 of file mythconverg_backup.pl.

$d_db_name = 'mythconverg'

Definition at line 59 of file mythconverg_backup.pl.

$d_mysqldump = 'mysqldump'

Definition at line 60 of file mythconverg_backup.pl.

$d_compress = 'gzip'

Definition at line 61 of file mythconverg_backup.pl.

$d_rotate = 5

Definition at line 62 of file mythconverg_backup.pl.

$d_rotateglob = $d_db_name.'-????-??????????????.sql*'

Definition at line 63 of file mythconverg_backup.pl.

$mysqldump = $d_mysqldump

Definition at line 66 of file mythconverg_backup.pl.

Referenced by open().

$compress = $d_compress

Definition at line 67 of file mythconverg_backup.pl.

Referenced by open().

$rotate = $d_rotate

Definition at line 68 of file mythconverg_backup.pl.

Referenced by open().

$rotateglob = $d_rotateglob

Definition at line 69 of file mythconverg_backup.pl.

Referenced by open().

$debug = 0

Definition at line 70 of file mythconverg_backup.pl.

sub print_version_information my $script_name = substr $0

Definition at line 97 of file mythconverg_backup.pl.

print $NAME n $script_name nversion

Definition at line 98 of file mythconverg_backup.pl.

__pad0__

Definition at line 705 of file mythconverg_backup.pl.

stopped
if it exists

Definition at line 1444 of file mythconverg_backup.pl.

Referenced by AlbumArtImages::addImage(), UPnpCDSTv::AddItem(), UPnpCDSVideo::AddItem(), Content::AddRecordingLiveStream(), PathSetting::addSelection(), Video::AddVideo(), Content::AddVideoLiveStream(), DBUtil::BackupDB(), ImageSearchResultsDialog::Create(), MetadataResultsDialog::Create(), MythBrowser::Create(), RingBuffer::Create(), VideoDialog::CreatePlayMenu(), EditAlbumartDialog::customEvent(), SingleView::DisplayNext(), GLSingleView::DisplayNext(), SingleView::DisplayPrev(), GLSingleView::DisplayPrev(), DBUtil::DoBackup(), BurnMenu::doBurn(), NetSearch::doDownloadAndPlay(), NetTree::doDownloadAndPlay(), MythWebView::doDownloadRequested(), GLSingleView::EffectKenBurns(), NativeArchive::exportRecording(), MusicMetadata::Filename(), XmltvID::fillSelections(), findIcon(), RomInfo::FindImage(), MythUIHelper::FindThemeFile(), HTTPRequest::FormatFileResponse(), get_filename(), Content::GetAlbumArt(), MusicMetadata::getAlbumArtFile(), DBUtil::GetBackupDirectory(), Guide::GetChannelIcon(), VideoDialog::GetCoverImage(), Content::GetFile(), SSDPExtension::GetFile(), Content::GetImageFile(), VideoDialog::GetImageFromFolder(), InternetContent::GetInternetContent(), InternetContent::GetInternetSearch(), Content::GetMusic(), MetadataDownload::getMXMLPath(), MetadataDownload::getNFOPath(), GetPlaybackURL(), Content::GetPreviewImage(), Content::GetRecording(), ImageView::GetScreenShot(), DVDThemeSelector::getThemeList(), Content::GetVideo(), Channel::GetXMLTVIdList(), MainServer::HandleQueryCheckFile(), ATSCStreamData::HasCachedCVCT(), ATSCStreamData::HasCachedTVCT(), NativeArchive::importRecording(), ImportIconsWizard::initialLoad(), MythBurn::isArchiveItemValid(), isRemote(), Jitterometer::Jitterometer(), LircDaemonDevice(), ThemeChooser::Load(), MythBurn::loadEncoderProfiles(), mythfile_exists(), MythImageReader::MythImageReader(), MythCDROM::onDeviceMounted(), FileRingBuffer::OpenFile(), MythMediaDevice::performMountCmd(), HtmlServerExtension::ProcessRequest(), ProgramInfo::ProgramInfo(), ThumbItem::Remove(), EditAlbumartDialog::removeCachedImage(), GalleryUtil::Rename(), GalleryUtil::RenameDirectory(), MetadataImageDownload::run(), RunCCExtract(), runScan(), ExportNative::runScript(), MythBurn::runScript(), XmlConfiguration::Save(), showLogViewer(), NetSearch::showMenu(), NetTree::slotItemChanged(), RSSEditPopup::slotSave(), MythMainWindow::StartLIRC(), DVDThemeSelector::themeChanged(), RecordingSelector::titleChanged(), GameHandler::UpdateGameDB(), MythNews::updateInfoView(), NetTree::UpdateItem(), ImportCoverArtDialog::updateStatus(), XNVCTRLQueryTargetAttribute(), XNVCTRLQueryTargetBinaryData(), XNVCTRLQueryTargetStringAttribute(), XNVCTRLQueryValidTargetAttributeValues(), and NativeArchive::~NativeArchive().

if it should be a database $database_information_file = shift

Definition at line 1446 of file mythconverg_backup.pl.

configure_environment

Definition at line 1448 of file mythconverg_backup.pl.

read_config

Definition at line 1449 of file mythconverg_backup.pl.

check_config

Definition at line 1450 of file mythconverg_backup.pl.

print_configuration

Definition at line 1452 of file mythconverg_backup.pl.

exit $status = 1

Definition at line 1454 of file mythconverg_backup.pl.