NEED A DAILY SCHEDULER SCRIPT... HELP PLS

You can share your Lua Scripts with everybody here.

NEED A DAILY SCHEDULER SCRIPT... HELP PLS

Postby supreme » Sat Nov 05, 2011 1:04 pm

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 !!
supreme
 
posts 23
 
joined Sat Oct 08, 2005 2:25 am

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

Postby FTP » Mon Nov 07, 2011 11:17 am

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
FTP
Site Admin
 
posts 1212
 
joined Tue Sep 29, 2009 6:09 am

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

Postby supreme » Wed Nov 09, 2011 10:46 am

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
supreme
 
posts 23
 
joined Sat Oct 08, 2005 2:25 am

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

Postby FTP » Wed Nov 09, 2011 1:34 pm

TYPE: ONCE HOUR
FTP
Site Admin
 
posts 1212
 
joined Tue Sep 29, 2009 6:09 am

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

Postby supreme » Wed Nov 09, 2011 11:04 pm

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

Thanks
supreme
 
posts 23
 
joined Sat Oct 08, 2005 2:25 am

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

Postby FTP » Thu Nov 10, 2011 3:48 am

Please check out the script, this script will be triggered 2 times everyday.
FTP
Site Admin
 
posts 1212
 
joined Tue Sep 29, 2009 6:09 am

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

Postby supreme » Thu Nov 10, 2011 11:25 am

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
supreme
 
posts 23
 
joined Sat Oct 08, 2005 2:25 am

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

Postby FTP » Thu Nov 10, 2011 11:37 am

I have already tested it, no problem.

Image
FTP
Site Admin
 
posts 1212
 
joined Tue Sep 29, 2009 6:09 am

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

Postby supreme » Fri Nov 11, 2011 8:48 am

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

Thanks
supreme
 
posts 23
 
joined Sat Oct 08, 2005 2:25 am

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

Postby FTP » Fri Nov 11, 2011 9:13 am

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

Code: Select all
print(tonumber(os.date("%H")))
FTP
Site Admin
 
posts 1212
 
joined Tue Sep 29, 2009 6:09 am

Next

Return to Lua scripts

Who is online

Users browsing this forum: No registered users and 1 guest