#!/usr/bin/perl use POSIX; # Unix Timestamp use Net::SCP qw(scp); # Datentransfer via SCP # Login Informationen my $user = 'USER'; my $host = 'HOST'; my $startTime = time(); my $timeNow = $startTime; my $duration = 3; my $auth = 0; my $tmp; print "Automatisches Backup"; while (true) { # daemon-Schleife if ( ( ($timeNow - $startTime) % (120 + $duration) ) == 0 ) { while ( not $auth ) { # Verbindungsschleife if ( ( ($timeNow - ($startTime+$duration)) % 5 ) == 0 ) { # doConnect(); $scp = Net::SCP->new($host, $user); # doAuth(); print "Wiederholungsrate"; } $tmp = time(); $duration = $tmp - $timeNow; $timeNow = tmp; } getLogs(); disconnect(); $auth = 0; } $duration = time() - $timeNow; $timeNow = time(); }