diff --git a/HP_printer_555/hp_smart_tank_plus_555_head_clean.ps1 b/HP_printer_555/hp_smart_tank_plus_555_head_clean.ps1 index 3ca66c8..91d8fcb 100644 --- a/HP_printer_555/hp_smart_tank_plus_555_head_clean.ps1 +++ b/HP_printer_555/hp_smart_tank_plus_555_head_clean.ps1 @@ -5,8 +5,8 @@ # requere installed snmp # set time when printer can run head cleanning -$running_time_start = 8 -$running_time_stop = 22 +$running_time_start = 10 +$running_time_stop = 20 # set day interval between last print and head cleannig $days_between = 7 @@ -18,7 +18,7 @@ $path_last_run = "$($location)/hp_clean_last_run" $path_log = "$($location)/hp_clean_log" $snmp_ver = "2c" $snmp_community = "public" -$snmp_code = "iso.3.6.1.2.1.43.10.2.1.4.1.1" # OID for printed pages +$snmp_code = "iso.3.6.1.2.1.43.10.2.1.4.1.1" # OID for printed pages durring actuall sesion $printer_ip = "" # printer IP $url = "http://$($printer_ip)/DevMgmt/InternalPrintDyn.xml" # url where we need to POST body for start HEAD cleaning. $body = "cleaningVerificationPage" @@ -56,7 +56,8 @@ function log_store { } } $logs += log -l_level 0 -l_message "Script Started" -$actual_time = get-date -Format "yyyy-MM-dd HH:mm:ss.ffff" + +$actual_time = get-date # check if hour of running isnt restricted by $running_time_start and $running_time_stop if (($actual_time.hour -lt $running_time_start) -and ($actual_time.hour -gt $running_time_stop)) { @@ -65,6 +66,8 @@ if (($actual_time.hour -lt $running_time_start) -and ($actual_time.hour -gt $run exit } +$actual_time = get-date -Format "yyyy-MM-dd HH:mm:ss.ffff" + # check / create last run control file if (-not(Test-Path $path_last_run)) { $logs += log -l_level 1 -l_message "$($path_last_run) Does not exists - CREATING." @@ -120,6 +123,6 @@ $last_run.p_count = $actual_p_count $last_run | Export-Csv -Path $path_last_run -NoTypeInformation -$logs += log -l_level 0 -l_message "Head Cleaning Stopped. Actual date: $actual_time. Actuall printed page count: $actual_p_count" +$logs += log -l_level 0 -l_message "Head Cleaning Stopped. Actual date: $actual_time. Actuall printed page count: $actual_p_count." log_store exit \ No newline at end of file