Win - send FINISH command at certain time

Moderators: Site Moderators, FAHC Science Team

Post Reply
foldinghomealone
Posts: 146
Joined: Wed Feb 01, 2017 7:07 pm
Hardware configuration: 5900x + 5080

Win - send FINISH command at certain time

Post by foldinghomealone »

Hi there,

I'm back, at least I will be trying to fold in the cold months.
However, due to my current electricity price, I can afford folding only in the night (because it is way cheaper in the night).
Is there an option to somehow send the FINISH command to the new client?

Ideally, it would be possible per resource group. (as different HW needs different finishing times)

Is there a way to do so?
I hope so, otherwise I won't be able to fold. I can't afford to get up at 3am just to press the finish button.

Thanks in advance
Image
calxalot
Site Moderator
Posts: 1656
Joined: Sat Dec 08, 2007 1:33 am
Location: San Francisco, CA
Contact:

Re: Win - send FINISH command at certain time

Post by calxalot »

calxalot
Site Moderator
Posts: 1656
Joined: Sat Dec 08, 2007 1:33 am
Location: San Francisco, CA
Contact:

Re: Win - send FINISH command at certain time

Post by calxalot »

If python is not installed, you can get prompted to install it from the Microsoft store.
Open powershell and use command

Code: Select all

python --version
foldinghomealone
Posts: 146
Joined: Wed Feb 01, 2017 7:07 pm
Hardware configuration: 5900x + 5080

Re: Win - send FINISH command at certain time

Post by foldinghomealone »

I will try today evening. Thanks.
Hope I can deal with it. Never used Python or Powershell etc...
Image
calxalot
Site Moderator
Posts: 1656
Joined: Sat Dec 08, 2007 1:33 am
Location: San Francisco, CA
Contact:

Re: Win - send FINISH command at certain time

Post by calxalot »

You will also need to use task scheduler.

https://www.bing.com/search?q=schedule% ... E3ED16BCAA
foldinghomealone
Posts: 146
Joined: Wed Feb 01, 2017 7:07 pm
Hardware configuration: 5900x + 5080

Re: Win - send FINISH command at certain time

Post by foldinghomealone »

yeah thank. Your lufah tool works great
Image
foldinghomealone
Posts: 146
Joined: Wed Feb 01, 2017 7:07 pm
Hardware configuration: 5900x + 5080

Re: Win - send FINISH command at certain time

Post by foldinghomealone »

I wanted to share the scripts I'm using to send a finish command at a certain time:

I have one Resource Group for my GPU ("gpu") and one Resource Group for my CPU ("cpu").
I am using two scripts for each Resource Group.

The first scripts schedules a task to start the second script at a certain time.
The second script will then send the FINISH command to the FAH client.

First script --> schedules task to start second script at certain time

Code: Select all

@echo off
:: ======================================
:: foldinghomaleone
:: CONFIGURATION – ADJUST ONLY HERE
:: ======================================
set STARTTIME=04:45
set TASKNAME=MyScheduledGPUTask
set TASKFILE="C:\Users\me\Desktop\gpufinish.bat"

:: ======================================
:: Convert STARTTIME to HHmm format for comparison (e.g. 04:00 -> 0400)
set TIMECOMPARE=%STARTTIME::=%

:: Get current time in HHmm format
for /f %%i in ('powershell -command "Get-Date -Format HHmm"') do set CURRENTTIME=%%i

:: ======================================
:: Determine start date: today or tomorrow?
if %CURRENTTIME% GEQ %TIMECOMPARE% (
    :: After the scheduled time – schedule task for tomorrow
    for /f %%i in ('powershell -command "(Get-Date).AddDays(1).ToString('MM/dd/yyyy')"') do set STARTDATE=%%i
) else (
    :: Before the scheduled time – schedule task for today
    for /f %%i in ('powershell -command "(Get-Date).ToString('MM/dd/yyyy')"') do set STARTDATE=%%i
)

:: ======================================
:: Create or replace the scheduled task
SCHTASKS /Create /SC ONCE /TN "%TASKNAME%" /TR %TASKFILE% /ST %STARTTIME% /SD %STARTDATE% /F

:: ======================================
:: Show scheduled task info (directly from Task Scheduler)
echo.
echo === Scheduled Task Information ===
SCHTASKS /Query /TN "%TASKNAME%" /V /FO LIST

pause
Second script --> finish command

Code: Select all

@echo off
cd c:\Users\me

:: systax: lufah -a /RescourceGroup finish
lufah -a /gpu finish

echo GPU set to finish at %TIME%
pause
Feel free to share and adjust to your liking
Image
appepi
Posts: 133
Joined: Wed Mar 18, 2020 2:55 pm
Hardware configuration: HP Z600 (5) HP Z800 (3) HP Z440 (3) HP Z4G4 (3) ASUS Turbo GTX 1060, 1070, 1080, RTX 2060 (3) Dell GTX 1080 NVIDIA P1000 (2) K1200
Location: Sydney Australia

Re: Win - send FINISH command at certain time

Post by appepi »

Thanks. I have the same need to control folding time (off peak electricity 10pm-7am) and currently use 7.6.21 and Lar Systems timer, but will presumably try this when/if they stop working.
Image
Post Reply