Indirectly related to what David T. said, i’ve found that the better i treat my body in a general and holistic sense, the more it maximizes what exercise i do. Diet, reducing stress, having positive attitudes, and spiritual strengthening (meditation/prayer, service, etc) all play a factor in how vital or not the body is independent of the exercise factor, or so i’ve found via a lot of experimenting, refining, core changes over the years.
Diet is a huge factor. I eat A LOT of low starch, highly nutrient dense veggies (like collard greens, broccoli, spring mix salad, etc), a little bit of whole food, gluten free carbs (brown rice, quinoa, amaranth etc), some only select, easier to digest legumes like lentils, the only dairy i do is goat and sheep sourced (much easier to digest than cow) and not a lot of it, and occasional select fish for otherwise hard to source nutrients (mostly Wild Alaskan Salmon and sardines–which btw, i consider a super food). I also get extra iodine through eating a lot of kelp sourced from northeastern Canada (i mix it with a little himalyan salt and use it for salting purposes). Certain seeds and nuts like chia, cashews, etc I also eat a good amount of fermented or cultured foods like unpasteurized sauerkraut, kimchi, goat yogurt, etc. Oils are mostly extra virgin olive and coconut.
The only times that i ever get a cold or sick, is when i majorly deviate from the above (and i occasionally do, especially when traveling or visiting friends or family), or i become unusually stressed out/upset (which occasionally happens). When i do, rarely get sick, i’m usually good within a couple days, 3 at most, and i don’t go to the doctors, take antibiotics, etc. I don’t lift or do much upper body stuff (besides occasionally carrying or moving around a 100lb + client whom is wheel chair bound), but i’m naturally strong and muscular.
I’m 36, but i look and feel younger (with generally a consistently good mood), and i don’t do as much exercise as i should (something i’m trying to work on). If i exercised ideally and meditated more, i’d probably age even more slowly/gracefully.
With all that said, i think it’s ok to eat less ideally on a long hike, since you’re burning so much of it off, processing toxins faster, and need the extra calories. But, on our upcoming CT hike, i plan to pack a combo of parsley flakes and kelp powder for extra food based nutrition (always way better absorbed and actually used than the huge majority of vitamins/minerals in pill forms) and dehydrating a good amount of cooked quinoa and lentils. I’m also trying to exercise more, but i’ve never really been a gym kind of guy, but maybe i should try that for the next month and a half.