diff options
Diffstat (limited to 'rhimport-zffe')
-rwxr-xr-x | rhimport-zffe | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/rhimport-zffe b/rhimport-zffe index ac55f46..fc34fc0 100755 --- a/rhimport-zffe +++ b/rhimport-zffe @@ -27,6 +27,7 @@ use Date::Calc; use Time::localtime; use IO::Handle; use IPC::Open3; +use File::Slurp; use lib '/usr/local/share/rhimport/'; use rhimport; @@ -46,7 +47,20 @@ if($#ARGV >= 0 && $ARGV[0] eq 'last') { print "!!!This is the last attempt, there won't be a retry on error!!!\n" } -my @import_day = Date::Calc::Today(); +my @today = Date::Calc::Today(); +my $dow = Date::Calc::Day_of_Week(@today); +my @tomorrow = Date::Calc::Add_Delta_Days($today[0], $today[1], $today[2], 1); + +my @tmp = Date::Calc::Standard_to_Business(@today); +$tmp[2] = 1; +my @this_mon = Date::Calc::Business_to_Standard(@tmp); +my @next_mon = Date::Calc::Add_Delta_Days($this_mon[0], $this_mon[1], $this_mon[2], 7); + +my @import_day = @tomorrow; +if ($dow == 5) { + @import_day = @next_mon; +} + my $import_date = sprintf("%04d-%02d-%02d", @import_day); my $current_date = `cat $STAT_FILE`; if($current_date eq $import_date) { @@ -86,7 +100,7 @@ sub get_note { my $sum_title = "focus europa, zip-fm (WH)"; my $sum_text = get_note($FE_NOTE_FILE) . "<br/>\n"; -$sum_text = $sum_text . get_note($ZF_NOTE_FILE) . "<br/>\n"; +$sum_text = $sum_text . "<br/>\n" . get_note($ZF_NOTE_FILE) . "<br/>\n"; $sum_text = $sum_text . "<br/><br/>\n"; print "\nsummary:\n" . $sum_title . "\n\n" . $sum_text . "\n"; |