Page 1 of 2
NEED A DAILY SCHEDULER SCRIPT... HELP PLS
Posted: Sat Nov 05, 2011 1:04 pm
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 !!
Re: NEED A DAILY SCHEDULER SCRIPT... HELP PLS
Posted: Mon Nov 07, 2011 11:17 am
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
Re: NEED A DAILY SCHEDULER SCRIPT... HELP PLS
Posted: Wed Nov 09, 2011 10:46 am
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
Re: NEED A DAILY SCHEDULER SCRIPT... HELP PLS
Posted: Wed Nov 09, 2011 1:34 pm
by FTP
TYPE: ONCE HOUR
Re: NEED A DAILY SCHEDULER SCRIPT... HELP PLS
Posted: Wed Nov 09, 2011 11:04 pm
by supreme
why once hour?
once day means once everyday right ?
correct me if im wrong...
Thanks
Re: NEED A DAILY SCHEDULER SCRIPT... HELP PLS
Posted: Thu Nov 10, 2011 3:48 am
by FTP
Please check out the script, this script will be triggered 2 times everyday.
Re: NEED A DAILY SCHEDULER SCRIPT... HELP PLS
Posted: Thu Nov 10, 2011 11:25 am
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
Re: NEED A DAILY SCHEDULER SCRIPT... HELP PLS
Posted: Thu Nov 10, 2011 11:37 am
by FTP
I have already tested it, no problem.
Re: NEED A DAILY SCHEDULER SCRIPT... HELP PLS
Posted: Fri Nov 11, 2011 8:48 am
by supreme
my pc is not set in 24hr format...should that make any difference?
Thanks
Re: NEED A DAILY SCHEDULER SCRIPT... HELP PLS
Posted: Fri Nov 11, 2011 9:13 am
by FTP
You can check it through "Administration -> Console", just execute the following script: