From ff1f32a86f092b0d0bc8bdf129483588774b1c98 Mon Sep 17 00:00:00 2001 From: Bert Burgemeister Date: Wed, 20 Jan 2010 16:06:35 +0100 Subject: [PATCH] Monikop's config changed s/// for uniformity with Pokinom. A few additions to documentation. --- .gitignore | 1 + doc/footer.muse | 2 +- doc/installation.muse | 4 ++-- doc/usage.muse | 19 +++++++++++++++---- monikop | 25 +++++++++++-------------- monikop.config.example | 50 ++++++++++++++++++++++++++++---------------------- pokinom.config.example | 37 +++++++++++++++++++++---------------- 7 files changed, 79 insertions(+), 59 deletions(-) diff --git a/.gitignore b/.gitignore index 2d19fc7..bee0122 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ *.html +monikop.config diff --git a/doc/footer.muse b/doc/footer.muse index 26ae636..f02fee3 100644 --- a/doc/footer.muse +++ b/doc/footer.muse @@ -1,2 +1,2 @@ #disable-tables t -Copyright © 2010 | [[mailto:trebb@users.berlios.de?subject=MONIKOP ][Bert Burgemeister]] +Copyright © 2010 | [[mailto:trebbu@googlemail.com?subject=MONIKOP ][Bert Burgemeister]] diff --git a/doc/installation.muse b/doc/installation.muse index 8696f0b..55926d5 100644 --- a/doc/installation.muse +++ b/doc/installation.muse @@ -2,7 +2,6 @@ #subtitle rsync between unconnected hosts - * Installation We assume Debian GNU/Linux here, but any distribution should @@ -256,7 +255,8 @@ logfile = rsyncd.log transfer logging = false -Configure service rsync for automatic start. +Configure service RsyncServer: right-click My Computer; click Manage, Services +and Applications, Services, RsyncServer; set Startup Type to Automatic. #Network_Setup diff --git a/doc/usage.muse b/doc/usage.muse index 83b68bc..2d2d5e2 100644 --- a/doc/usage.muse +++ b/doc/usage.muse @@ -46,22 +46,33 @@ must be rebooted once this hasn't been the case. - You have to be able to tell from your data if it's complete. - data transferred, but to ignore - Backup functionality: data remains on disks until re-inserted in - Monikop. Names in use. - + Monikop. Names in use. How to recover. + - Re-copy data from Source: delete from log the two files per Source that + are named by $rsync_log_prefix and $finished_prefix in [[installation#monikop.config][=monikop.config=]]. ** fsck-pokinom + - TODO: unfinished - fsck-pokinom: to be run by root * Bugs - - Data must not contain any directories called $rsync_partial_dir_name + - Payload data must not contain any directories with the names set in + [[installation#monikop][=monikop.config]]/[[installation#pokinom.config][pokinom.config]] + by =$rsync_partial_dir_name=. - Doesn't reflect disappearance of files on sources - May ignore empty dirs (really?) - During copying, obsolete versions of some files may temporarily be on destination (after interrupted transfer of files which then have grown larger) - - frequent power cuts (as opposed to normal shutdown operations) may + - frequent power cuts (as opposed to normal shutdown operations) may compromise efficiency in terms of disk usage. + - By running multiple instances of Rsync, Monikop puts considerable strain + to the system, which may reveal previously unnoticed hardware faults. + +; System reports disk error on (say) /dev/sdb1. What is it's label? +; ls -l /dev/disk/by-label + +; Monikop and Pokinom will create the directories they need. \ No newline at end of file diff --git a/monikop b/monikop index 47b8a3a..a1b48e0 100755 --- a/monikop +++ b/monikop @@ -39,15 +39,15 @@ my @usable_mount_points; # Common directory (under a mount point) to put new data in. # Must agree with Pokinom's setting. -my $path_in_destination; +my $path_under_mount_point; # Directories (under any mount point) of this name will be deleted # Must agree with Pokinom's setting. -my $path_in_destination_backed_up; +my $path_under_mount_point_backed_up; # Directory name (under a mount point) while being deleted. # Must agree with Pokinom's setting. -my $path_in_destination_being_deleted; +my $path_under_mount_point_being_deleted; # Path and file name prefix of rsync's raw logs: my $rsync_log_prefix; @@ -236,7 +236,7 @@ sub rsync_preparation_form { join (', ', map { '\\\'--compare-dest=' . $_ . '/' - . $path_in_destination . '/'. + . $path_under_mount_point . '/'. $source_dirs_in_destination{$source} . '/\\\'' } @@ -281,7 +281,7 @@ sub rsync_someplace { my $finished_name = $finished_prefix . $source; foreach (@destinations) { $destination_source_is_writing_to{$source} = $_; - my $common_destination = $_ . '/' . $path_in_destination; + my $common_destination = $_ . '/' . $path_under_mount_point; my $complete_destination = $common_destination . '/' . $source_dirs_in_destination{$source}; qx(mkdir -p $common_destination); @@ -322,9 +322,9 @@ debug_print @destination_roots; # Clean up destinations: map { - my $p_i_d = $_ . '/' . $path_in_destination; - my $p_i_d_backed_up = $_ . '/' . $path_in_destination_backed_up; - my $p_i_d_being_deleted = $_ . '/' . $path_in_destination_being_deleted; + my $p_i_d = $_ . '/' . $path_under_mount_point; + my $p_i_d_backed_up = $_ . '/' . $path_under_mount_point_backed_up; + my $p_i_d_being_deleted = $_ . '/' . $path_under_mount_point_being_deleted; if (-d $p_i_d_backed_up and -d $p_i_d_being_deleted) { warn "[" . $$ . "] " . "Both $p_i_d_backed_up and $ p_i_d_being_deleted exist.\n" . @@ -419,7 +419,7 @@ $destinations_monitor_thread = async { map { my $source_root = $_; my $complete_destination = $destination_root . '/' - . $path_in_destination . '/' + . $path_under_mount_point . '/' . $source_dirs_in_destination{$source_root}; my @dir = qx(ls -A $complete_destination/ 2> /dev/null); $destination_usage = 1 if scalar @dir; # 0 = no new data @@ -434,11 +434,8 @@ $destinations_monitor_thread = async { } }; -if ($debug == 1) { -# Let the workers toil. - sleep; -} else { -# Let the workers toil; talk to the user. +unless ($debug == 1) { +# Talk to the user. $display_thread = async { $SIG{TERM} = sub { diff --git a/monikop.config.example b/monikop.config.example index 8e772d2..7db232f 100644 --- a/monikop.config.example +++ b/monikop.config.example @@ -1,21 +1,23 @@ -# -*- perl -*- -############################################################# -# Monikop Settings +# (This is -*- perl -*- code.) +############################################################################## +# Monikop's configuration file. # -# Copy this file to monikop.config and adapt it to your needs. -############################################################## -# Possible data sources, and by what directory name to represent them in -# destination. +# Copy this file to `monikop.config' and adapt it to your needs. +############################################################################## + +# Possible data Sources, and by what directory name to represent them in +# Destination. # When the latter is not unique, care must be taken that all pathnames in the -# respective sources are unique. +# respective Sources are unique, or files will overwrite each other in +# unpredictable ways. %sources = ( - 'data_producer1::data' => 'p1', - 'data_producer2::data' => 'p2', + 'data_producer1::data' => 'p1_dir', + 'data_producer2::data' => 'p2_dir', 'data_producer3::data' => '', 'data_producer4::data' => '', ); -# Possible mount points of data destinations. Must be unique. +# Possible mount points of the removable disks. @usable_mount_points = ( '/media/disk_1', '/media/disk_2', @@ -24,32 +26,33 @@ # Common directory (under a mount point) to put new data in. # Must agree with Pokinom's setting. -$path_in_destination = +$path_under_mount_point = 'measuring_data' ; -# Directories (under any mount point) of this name will be deleted +# Directories (under any mount point) of this name will be deleted by Monikop. # Must agree with Pokinom's setting. -$path_in_destination_backed_up = +$path_under_mount_point_backed_up = 'backed_up' ; # Directory name (under a mount point) while being deleted. # Must agree with Pokinom's setting. -$path_in_destination_being_deleted = +$path_under_mount_point_being_deleted = 'being_deleted' ; -# Path and file name prefix of rsync's raw logs: +# Path and file name prefix for rsync's raw logs: $rsync_log_prefix = - '/tmp/monikop/log.' + '~/log/monikop/log.' ; -# Path and file name prefix of the list of successfully rsynced files: +# Path and file name prefix for the list of successfully rsynced files: $finished_prefix = - '/tmp/monikop/finished.' + '~/log/monikop/finished.' ; +# Safe files are supposed to survive power cuts during write operations. # How to suffix the name of the duplicate of a safe file: $safe_file_backup_suffix = '.bak' @@ -70,13 +73,16 @@ $key_f6_action = "sudo reboot" ; -# Rsyncs time (in seconds) to wait for a response: +# Rsyncs time (in seconds) to wait for a response. This is roughly the time +# Monikop needs to notice the disappearance of a Source. Must not be 0. $rsync_timeout = 30 ; -# Rsyncs directory (relative to destination) for partially transferred files. -# Must agree with Pokinom's setting. +# Rsyncs directory (relative to mount point of removable disk) for partially +# transferred files. +# Must agree with Pokinom's setting. Make sure your payload data does not +# contain an equally-named directory. $rsync_partial_dir_name = '.rsync_partial' ; diff --git a/pokinom.config.example b/pokinom.config.example index 2c3e15b..574e176 100644 --- a/pokinom.config.example +++ b/pokinom.config.example @@ -1,10 +1,11 @@ -# -*- perl -*- -############################################################## -# Settings +# (This is -*- perl -*- code.) +######################################################################## +# Pokinom's configuration file. # -# Copy this file to pokinom.config and adapt it to your needs. -############################################################## -# Possible mount points. +# Copy this file to `pokinom.config' and adapt it to your needs. +######################################################################## + +# Possible mount points of the removable disks: @usable_mount_points = ( '/media/disk_1', '/media/disk_2', @@ -28,11 +29,12 @@ $path_under_mount_point_being_deleted = 'being_deleted' ; -# Data destination: +# Data Destination: $destination = - 'big-server::incoming/NEW_DATA'; + 'big-server::incoming/NEW_DATA' + ; -# Credentials of the remote rsync server. String, or 0 if not used: +# Credentials of the rsync server on Destination. String, or 0 if not used: $rsync_username = 'm-operator' ; @@ -42,27 +44,30 @@ $rsync_password = # Path and file name prefix to rsync's raw log: $rsync_log_prefix = - '/tmp/pokinom/log.' + '~/log/pokinom/log.' ; # Path and file name prefix to a file where a list of rsync's incompletely -# transferred files is stored in: +# transferred files is kept: $interrupted_prefix = - '/tmp/pokinom/interrupted.' + '~/log/pokinom/interrupted.' ; -# Shut down when finished? (default); 1 = yes; 2 = stay on. +# Shut down when finished? (Default, can be toggled by user by pressing F9.) +# 1 = yes; 2 = stay on. $shut_down_when_done = 0 ; -# How to turn off: +# What to do (shutdown) when F3 has been pressed: $shut_down_action = "sudo halt -p" ; -# Rsync's directory (relative to destination) for partially transferred files. -# Must agree with Monikop's setting. +# Rsync's directory (relative to mount point of removable disk) for partially +# transferred files. +# Must agree with Monikop's setting. Make sure your payload data does not +# contain an equally-named directory. $rsync_partial_dir_name = '.rsync_partial' ; -- 2.11.4.GIT