NEED A DAILY SCHEDULER SCRIPT... HELP PLS

You can share your Lua Scripts with everybody here.
supreme
Posts: 23
Joined: Sat Oct 08, 2005 2:25 am
Contact:

NEED A DAILY SCHEDULER SCRIPT... HELP PLS

Post by supreme »

HI THERE...
i need a script to schedule wingftp server online and offline everyday.
i need server to be online at 11pm till 7am.
can anyone help me how to set that up pls ?

Thanks !!
FTP
Site Admin
Posts: 2072
Joined: Tue Sep 29, 2009 6:09 am

Re: NEED A DAILY SCHEDULER SCRIPT... HELP PLS

Post by FTP »

Here is the script:

Code: Select all

local nowHour = tonumber(os.date("%H"))

if nowHour == 23 then 
    c_StartDomain("YourDomainName")
end

if nowHour == 7 then 
    c_StopDomain("YourDomainName")
end
supreme
Posts: 23
Joined: Sat Oct 08, 2005 2:25 am
Contact:

Re: NEED A DAILY SCHEDULER SCRIPT... HELP PLS

Post by supreme »

ok thanks man :)
pls verify if im doing it well ....
TYPE: ONCE DAY
Start DATE as TODAYS date..
Start TIME as CURRENT time..
Common API - paste your script there


Thanks again
FTP
Site Admin
Posts: 2072
Joined: Tue Sep 29, 2009 6:09 am

Re: NEED A DAILY SCHEDULER SCRIPT... HELP PLS

Post by FTP »

TYPE: ONCE HOUR
supreme
Posts: 23
Joined: Sat Oct 08, 2005 2:25 am
Contact:

Re: NEED A DAILY SCHEDULER SCRIPT... HELP PLS

Post by supreme »

why once hour?
once day means once everyday right ?
correct me if im wrong...

Thanks
FTP
Site Admin
Posts: 2072
Joined: Tue Sep 29, 2009 6:09 am

Re: NEED A DAILY SCHEDULER SCRIPT... HELP PLS

Post by FTP »

Please check out the script, this script will be triggered 2 times everyday.
supreme
Posts: 23
Joined: Sat Oct 08, 2005 2:25 am
Contact:

Re: NEED A DAILY SCHEDULER SCRIPT... HELP PLS

Post by supreme »

i can't get it to work :(
at 23 it did not turn on and at 7 it did not shutdown.
This is my script:

local nowHour = tonumber(os.date("%H"))

if nowHour == 23 then
c_StartDomain("supreme")
end

if nowHour == 7 then
c_StopDomain("supreme")
end
FTP
Site Admin
Posts: 2072
Joined: Tue Sep 29, 2009 6:09 am

Re: NEED A DAILY SCHEDULER SCRIPT... HELP PLS

Post by FTP »

I have already tested it, no problem.

Image
supreme
Posts: 23
Joined: Sat Oct 08, 2005 2:25 am
Contact:

Re: NEED A DAILY SCHEDULER SCRIPT... HELP PLS

Post by supreme »

my pc is not set in 24hr format...should that make any difference?

Thanks
FTP
Site Admin
Posts: 2072
Joined: Tue Sep 29, 2009 6:09 am

Re: NEED A DAILY SCHEDULER SCRIPT... HELP PLS

Post by FTP »

You can check it through "Administration -> Console", just execute the following script:

Code: Select all

print(tonumber(os.date("%H")))
Post Reply