d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Paying All My Fg For Cron Job/google App Help
Prev1234Next
Add Reply New Topic New Poll
Member
Posts: 2,354
Joined: Dec 9 2014
Gold: 0.00
Feb 26 2017 01:50pm
erm some kind of control panel
Quote (nuvo @ Feb 26 2017 12:44pm)
How do you normally start it? Some datacenter managament panel? IPMI/iDrac?


Member
Posts: 3,197
Joined: May 4 2013
Gold: 1,457.00
Feb 26 2017 02:04pm
What's your hosting? Do they have API? Worst case you'd need a script that's logging on their site, parses html and clicks the button, but that's very annoying and can easily break if they change their site, so not recommended.

But if they have cloud type feature where you are billed per hour they should have an api. If you link me to that I might be able to help
Member
Posts: 2,354
Joined: Dec 9 2014
Gold: 0.00
Feb 26 2017 02:54pm
Quote (nuvo @ Feb 26 2017 02:04pm)
What's your hosting? Do they have API? Worst case you'd need a script that's logging on their site, parses html and clicks the button, but that's very annoying and can easily break if they change their site, so not recommended.

But if they have cloud type feature where you are billed per hour they should have an api. If you link me to that I might be able to help


google cloud
https://cloud.google.com/
Member
Posts: 3,197
Joined: May 4 2013
Gold: 1,457.00
Feb 26 2017 04:34pm
Oh derp I didn't realize you can run windows on google cloud. So yeah I think the guy had good idea. Setup small instance running forever that will start/stop the windows one. f1.micro costs about $4/month. Of course install linux on f1.
From there, install gcloud according to this guide https://cloud.google.com/compute/docs/gcloud-compute/ and make sure it can manage your instances. Eg. gcloud compute instances list should show both f1.micro and the windows one. Let's call it "windows-server". Add to crontab on your f1.micro:

Code
0 7 * * * /usr/local/bin/gcloud compute instances start windows-server
0 19 * * * /usr/local/bin/gcloud compute instances stop windows-server


(assuming gcloud is installed in /usr/local/bin. You might need to change that to wherever its installed to)
and that should be it.

before you do, what kind of disk do you have attached there? Because this is important to note:
Quote
If your instance has a local SSD attached, you can stop the instance but you will not be able to restart the instance. The instance remains in the TERMINATED state until you delete it.


If you have persistent disk it should be fine

This post was edited by nuvo on Feb 26 2017 04:39pm
Member
Posts: 2,354
Joined: Dec 9 2014
Gold: 0.00
Feb 26 2017 04:48pm
ah so running an instance and having it run crontab is my best option and cheapest?

i believe the guy set it up with a ssd, should i have it redone with persistent disk instead?
Member
Posts: 3,197
Joined: May 4 2013
Gold: 1,457.00
Feb 26 2017 05:15pm
I don't think you have SSD since you already start/stop it, albeit manually. But do check, maybe somewhere in billing it will show your resource usage - disk, network etc? It should state what kind of disk.
This matters for the windows vm obviously. Small instance shouldn't matter, worst case you need to reinstall gcloud and crontab

And well yes it is cheapest, unless you already have some other server running 24/7.
Member
Posts: 2,354
Joined: Dec 9 2014
Gold: 0.00
Feb 26 2017 05:20pm

my windows vm is running ssd

the crontab is running pers disk
Member
Posts: 3,197
Joined: May 4 2013
Gold: 1,457.00
Feb 26 2017 05:52pm
Well, huh. Is the windows one running any other disk next to ssd? Is there only one?

I wonder how are you able to start/stop it and keep data, with what google said above then.
Member
Posts: 2,354
Joined: Dec 9 2014
Gold: 0.00
Feb 26 2017 06:03pm
yep, my windows serve is running on a ssd only
i can start, stop, restart and save all data
it's suppose to let me do that, isnt it? haha
Member
Posts: 3,197
Joined: May 4 2013
Gold: 1,457.00
Feb 26 2017 06:10pm
Ah wait I know where's the confusion from. There are two types of SSD they offer. Local SSD, which will not let you restart server, only shutdown & delete and create new with it. Those are more like cache disks, or temporary disks. And then persistent disks can be either HDD or SSD. And local SSD cannot be used as boot disk, and every compute instance comes with persistent drive. Can you confirm that you have persistent SSD drive, and no local SSD?

In the meantime setup gcloud on the mini server :)
Go Back To Programming & Development Topic List
Prev1234Next
Add Reply New Topic New Poll