Not long at all
The Internet is kept up only with an army of support engineers
The earlier answer about the power grid is correct, as well as the implication that one person simply cannot maintain enough equipment to keep things running.
But there's a detail that I happen to know because I work server-side in a web company, which I haven't seen anyone else mention.
No major website runs without constant human intervention. Behind the scenes, of course, all of these 'websites' actually run on banks of servers. These servers are far more finicky than most people would imagine. Machines have a hardware failure, and need replacement with new machines. Connectivity brown-outs require manual intervention to fix. The database machine's hard disk gets too full, causing performance to grind to a halt.
Every one of these companies has an operations group: a whole team of people whose job it is to write tools to let them monitor the health of the system, and to address the constant litany of issues that threaten system stability.
It is true that much of the chaos is due to changes on the backend causing problems. But not nearly all of it. The computer software running all these websites is, simply put, too complicated to run 100% unattended.
Getting a website back up would require significant reverse engineering
This is also why your main character would have difficulty ever getting any of these systems back online. The average website's back end consists of a complex architecture: something like a dozen different components that all depend on each other. To get the site back online would require understanding that infrastructure well enough to know how to restart everything yourself.
To gain this knowledge, MC would have to find the company's offices (no small feat without internet), find the servers running their internal wikis, their bug report database servers, etc. Then get them back up and running. Then MC has to find their source code. If it's stored on GitHub, well, that's that. You want to find a local copy sitting somewhere on a developer's laptop. Which MC now needs to break into, since they're all encrypted nowadays (because too many employees had lost or stolen laptops full of detailed personal info of too many companies' customers, totally unencrypted so anyone could read it). You can't even read the files without the password or a really clever hack.
Sure, hackers trying to crack DRM don't need any of that. But they're just trying to get one program to work. They don't have to get a whole suite of programs to all talk to each other in a highly complex dance.
Then, if MC wants all the old data to be accessible, MC now needs to find the actual data center where the data is stored. This could be very close to the dev's offices, but is more likely to be very far away. Assuming MC can even find out the location from the data available in the company offices.
Even for someone who knew exactly what they were doing, and had, like, a local copy of Stack Overflow and other online references saved locally (we don't memorize that stuff anymore; Google is usually faster than looking it up in a book), and who knew how to bypass login screens to get the info they need, this would still take months, likely years.
Then, once MC's got this one service back up, it won't stay up unless they're constantly keeping it happy (see point #1). Trying to keep services up that operate out of two data centers that aren't close together will be literally impossible.
And the inevitable fire, earthquake, flood, etc. will permanently destroy the service after a few decades anyway. Normally websites keep multiple redundant copies of production system data, but that won't be an option for our MC.
If MC made it their mission in life, and they were, pre-event, an honest-to-goodness expert genius programmer/hacker , and at rigging up small-scale power generators, they might be able to find useful services, and get versions of them that run on very small networks MC maintains personally. Each service would take years to develop, so there wouldn't be much time to salvage more than one or two. But that is not "the Internet" anymore, that's just a small local network.
Making new electronics is highly dubious
I'm a programmer, not a hardware guy. So I'll leave it at this: I find it very very likely similar limitations will make it essentially impossible for MC to make new hardware. MC might be able to cobble together working units out of recycled parts, but building new parts is probably impossible. Making integrated circuits requires clean rooms that can't even have a speck of dust get inside (because the little wires that make the circuits are much smaller now than your average speck of dust).
7
Long term survival of data has never been a prime concern, so expect the number of years to be quite small. That being said, https://xkcd.com/505/
– Cort Ammon – 2017-01-23T19:49:29.9872
You might want to look at What would it take for Jane Doe to craft a book from scratch?. See also our
– a CVn – 2017-01-23T19:49:54.477computers
tag, which has a number of relevant questions (for example, look for those on bootstrapping from scratch). There are also some similar, non-computer-related questions on the site. Then in the light of those, consider whether what you are proposing is plausible.1
The title is essentially a duplicate of http://worldbuilding.stackexchange.com/questions/41587/how-long-can-a-power-plant-continue-to-generate-electricity-without-maintenance (in general, probably measured not in years but in days until something between you and a particular server fails or loses power) and the rest of the question body should be split out as separate questions.
– Peteris – 2017-01-23T20:07:38.2833The public electric power grid will be gone in a few hours, at best one or two days. Some data centers have backup generators, but even those will exhaust their fuel in two or three days. Restarting such a center is hard. There is no way for one single human to make even the simplest integrated circuit -- there simply is nobody on Earth who knows in detail at the same time how to design one and how to fabricate one. Plus chip fabrication facilities use a lot of energy and a variety of highly dangerous chemicals such as hydrofluoric acid. – AlexP – 2017-01-23T21:52:53.690
@AlexP Rebuilding everything using stones on a grid, XKCD style, is looking better and better! =) – Cort Ammon – 2017-01-23T23:09:19.927
If you don't pay your electric bill, they will shut you down after a month or so. Post holocaust electricity disconnect for non-payment may be the only thing that works. – Gary Walker – 2017-01-24T01:19:23.603
@AlexP No one knew how to make a pencil in 1958 either: http://www.econlib.org/library/Essays/rdPncl1.html
– SRM – 2017-01-24T05:31:50.137It will probably take too many work-hours to maintain everything, even before nature destroys all the things that hold data. An eternity without cat-pictures, what a hell you are designing for your character... – Sec SE - clear Monica's name – 2017-01-24T15:03:38.533
First, you have to break into the utility companies, and shutdown all unnecessary consumption. 99% of the city will no longer need water,gas, or electricity. This will allow the electric,gas,water to remain operational longer. Then the generators will last much,much longer. – cybernard – 2017-01-24T15:30:04.663
A large hydroelectric plant will likely last the longest. – Michael Richardson – 2017-01-24T15:46:59.973
1This video addresses, at the beginning, the electrical part of your question. With some nice visuals too :) – Shimon bM – 2017-01-25T02:24:40.737
OP: What do you define as "the internet"? Are you talking about IP routing in particular, or does any global digital network count (e.g. AX.25)? – forest – 2018-08-29T18:00:15.050