Skip to content

Commit

Permalink
Added support to specify a specific ssh port to use when rsyncing
Browse files Browse the repository at this point in the history
  • Loading branch information
David Slater committed Sep 5, 2024
1 parent 35c7c97 commit 30dc319
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions etc/licor_towers.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
remove_old: false
infrequent: false
digest: false
port: 22
4 changes: 4 additions & 0 deletions lib/LicorSync/Licor.pm
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ sub rsync_data {
my $ip = $tower->{'ip'};
my $data_dir = $tower->{'data_dir'};
my $tower_name = $tower->{'name'};

my $local_data_dir = $LicorSync::Config::config->{'local_data_dir'};
print "\n".current_time()."Beginning rsync for $tower_name...\n";

Expand All @@ -38,6 +39,9 @@ sub rsync_data {
if (exists $tower->{'remove_source_files'} and $tower->{'remove_source_files'}) {
$rsync_options .= "--remove-source-files ";
}
if (exists $tower->{'port'}) {
$rsync_options .= "-e 'ssh -p " . $tower->{'port'} . "' ";
}
my $cmd = "/usr/bin/rsync -auv " . $rsync_options . "--timeout=1000 --chmod=Du=rwx,Dgo=rx,Fu=rw,Fog=r --include \"*/\" --include=*.ghg --exclude='*' licor\@$ip:$data_dir $local_data_dir/$tower_name/raw";
print $cmd . "\n";
system $cmd;
Expand Down

0 comments on commit 30dc319

Please sign in to comment.