Script that will run even if my computer is dead?

nauru

Member
Sep 11, 2009
30
0
0
I have a simple javascript that enters a specific username and password into a specific page on a website (not my own website) every 7 days. I need it to run on schedule, no matter what happens to my computer. What is the best way to go about setting this up? (does not have to be javascript, as long as the job gets done and is web-based).

I assume it has to be web-based so that there is no reliance on my personal computer. I have checked out some cron job websites but they don't seem to allow for me to enter my script; they will only call a url on a schedule and this seems kind of useless for my purposes.

For other scripts of this kind I would just use iMacros and have them play in Firefox but since that requires my computer to be switched on and online, that isn't useful in this case I don't think.

Can anyone please help me out with this?

Thanks folks.
 
Last edited:

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
If you can spend money, you can get web hosting somewhere with an account plan that allows PHP scripting and cron jobs.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Or a VPS so that you get a whole virtual server to yourself and can run whatever jobs you want.
 

EagleKeeper

Discussion Club Moderator<br>Elite Member
Staff member
Oct 30, 2000
42,589
5
0
If your copmuter is dead, you have no CPU cycles that can execute on that piece of H/W.
 

Red Squirrel

No Lifer
May 24, 2003
70,579
13,805
126
www.anyf.ca
If this is just for home, I'd just get a machine to act as a server and make it bash script that runs from a cron job. It can even email a log to you once it's done.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
If this is just for home, I'd just get a machine to act as a server and make it bash script that runs from a cron job. It can even email a log to you once it's done.

Except that misses the most important requirement...
 

Red Squirrel

No Lifer
May 24, 2003
70,579
13,805
126
www.anyf.ca
I don't think you understand what load balancing really does.

Why the hell would a process that runs ONCE a week need to be load balanced?

WEll if he really badly does not want it to fail, he could code it in a way where it is set to run on both servers, but once it runs, a signal is sent to next server to tell it not to run. Would have to be custom, but basically be a redundant setup where if one server goes down, the other can run the script.

This is kind of excessive though. My main server (non redundant) at home has been up for 102 days and the only reason it went down is because I had to run a BX cable into my electrical panel and did not really wan to do it live.
 
Last edited:

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
14
81
www.markbetz.net
I don't think you understand what load balancing really does.

Why the hell would a process that runs ONCE a week need to be load balanced?

True, but most load balancing systems also give you fail-over. The question is how serious is OP about the requirement that the script must run? Having two machines in your house doesn't ensure it runs if there's a disaster and the house is gone.

The VPS idea is probably sufficient, since you have a major-league IT organization guaranteeing the server uptime, but that still doesn't get you to absolutely 100% damn-well-sure the script will run. For that you need two machines in separate physical locations.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
For that you need two machines in separate physical locations.

And luck. There's nothing that will guarantee you 100&#37; effectiveness. One key router having a problem could easily affect two otherwise completely separate hosting providers.
 

Red Squirrel

No Lifer
May 24, 2003
70,579
13,805
126
www.anyf.ca
True, but most load balancing systems also give you fail-over. The question is how serious is OP about the requirement that the script must run? Having two machines in your house doesn't ensure it runs if there's a disaster and the house is gone.

The VPS idea is probably sufficient, since you have a major-league IT organization guaranteeing the server uptime, but that still doesn't get you to absolutely 100% damn-well-sure the script will run. For that you need two machines in separate physical locations.

Yeah there's never really a 100% guarantee. Without spending lot of money, for what his needs are, a single home server will probably do the trick. And by server, I mean a machine actually acting as server, not an everyday workstation that is constantly having work done on it.

A VPS / dedicated server is a good choice too but more costly. Depends how much money he's willing to spend on this and the actual importance of this script running.
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
14
81
www.markbetz.net
And luck. There's nothing that will guarantee you 100% effectiveness. One key router having a problem could easily affect two otherwise completely separate hosting providers.

True, companies spend a lot of money to get to five nines reliability levels.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
nd by server, I mean a machine actually acting as server, not an everyday workstation that is constantly having work done on it.

Why? Cron runs just as reliably on my workstation as it does on "servers".

A VPS / dedicated server is a good choice too but more costly. Depends how much money he's willing to spend on this and the actual importance of this script running.

A bit, but not much. Linode's smallest offering is $20/mo which is probably cheaper than any of his other bills.
 

Red Squirrel

No Lifer
May 24, 2003
70,579
13,805
126
www.anyf.ca
Why? Cron runs just as reliably on my workstation as it does on "servers".



A bit, but not much. Linode's smallest offering is $20/mo which is probably cheaper than any of his other bills.

Sure but do you want something critical running on a machine that is suppose to be a workstation and constantly being used for stuff like games and other forground activities? There is a much greater chance of causing issues, or requiring a reboot, then a machine sitting in a corner doing nothing but background tasks.

There is also the physical issues, a workstation is within reach of pets, kids, etc, while a server can be in a cabinet in the basement in a climate controlled room. In a home environment normally just the basement alone is good enough for cooling provided there is decent circulation.
 

jvroig

Platinum Member
Nov 4, 2009
2,394
1
81
If you can spend money, you can get web hosting somewhere with an account plan that allows PHP scripting and cron jobs.

Or a VPS so that you get a whole virtual server to yourself and can run whatever jobs you want.

These two make sense, given that the OP has already said this:
I assume it has to be web-based so that there is no reliance on my personal computer.

Webhosting is cheap (especially shared hosting, but there are VPS plans that are also very affodable), you can probably sign-up for shared hosting accounts from 2 or 3 providers. That way you have 2 or 3 accounts, all of them with the same script that is scheduled as you wish, and you have some peace of mind that you aren't just trusting your life on a single provider.
 

Modelworks

Lifer
Feb 22, 2007
16,240
7
76
For me I would just use a router to do it. One of the DDWRT models will let you access the linux side and then you can set up whatever you want. I do that with a netgear router I have that still runs the retail firmware by enabling debug features. I can then telnet in and add any scripts or functions I like.
 

tintino

Junior Member
Mar 24, 2010
6
0
0
I have a simple javascript that enters a specific username and password into a specific page on a website (not my own website) every 7 days.

This may be a little o/t ...

Here is me thinking outside the "standard box" :D
to answer: Could it be possible only with JS?

Obviously you're not gonna do this, and there are much better ways, but just for "education purposes"...

There are ways to post stuff on some websites that could load your JS script into other user's browsers...

For example:
You could inject your (modified) javascript into some popular site..a forum..a blog..etc.. some forums are made to strip "valid html" only... but there are tricks you could possibly use.. in the end your purpose is to get the browser to execute a script.

I often see js injected in forum posts and even in forum signatures in some popular forums.

Long time ago, (in my "script kiddie" days), i used Ebay, to insert js in my own listings. I had a js setup that would "post a form" to an external site that was offering free email accounts.
That site was limiting creating only 1 account per IP, and i wanted many many accounts.
The js in my ebay listing was being loaded by any user seeing my ebay listings. :p
So every Ebay user that saw my ebay listing was making me a free email account.
Silly i know...apparently back then, i had my own reasons for this "hack" :whiste: