What commands does `flyctl ssh --command` accept?

You’ll have to do it on every app restart though? I don’t think there’s any notification when an app is restarted. For example, Fly can (and does) move apps from one host to another, or restart it if it’s failing health checks, or restart them often like when you’re using Machines (which are inherently ephemeral). Unless you’re storing state on persistent disks, the app is going to start with a clean state.

I’ve seen folks use flyctl ssh console -C <command> The recommendation is to run shell scripts as <command> rather than exec binutils / coreutils (like cd, grep etc): One-liner to cd and run bundle (rails) - #5 by rubys