In reply to anonymous123:
Aside from trying your hardest to get a good amount of sleep as mentioned above, I think you just need to plan ahead.
Assuming you get at least a weeks notice of your shifts, i'd write down a plan of when you can fit in your sessions for that week, then try your best to stick to it.
I only work 4 days a week and i've noticed that if I earmark a session for a Friday (my day off), i'll think "oh ive got all day, ill easily manage that" but if I don't specifically plan to do the session at a particular time, I can end up just faffing about all day or being distracted by other things and either miss the session entirely or rush to squeeze it in at a non-ideal time.
If you can't rely on a regular routine to tell you when to train, then I think a bit of forward planning is the next best thing.