Skip to content
Reversibly pause a cron service for two weeks without deleting resources
caducamargos12-web
OP

a month ago

We need to reversibly pause an existing cron service for two weeks while preserving its service, volume, variables and source. It runs every five minutes, uses GitHub autodeploy and exits after each job. The dashboard shows No schedule and Remove on the deployment, but no Pause. Does disabling autodeploy, clearing the cron schedule and removing the deployment also prevent new executions after Railway migrations or maintenance? If not, what supported procedure keeps the service stopped for this period without deleting resources? To resume after image retention expires, can we rebuild the original revision while preserving the same volume and original configuration? Please confirm the effects and order of operations.

Solved

5 Replies

Railway
BOT

a month ago

Yes, that combination works, and none of those steps delete the service, its volume, its variables or its source settings. Removing a deployment only stops its containers. Clearing the cron schedule deletes the schedule itself, so no new runs fire, and with no active deployment left there is nothing for maintenance or a host migration to move. We don't have a separate Pause control for cron services, so this is the supported way to keep one stopped.

Use this order. First, turn off autodeploy, so a push during the two weeks can't create a new deployment. Second, clear the cron schedule. Third, remove the remaining deployment. Do the removal last: a deployment left in place after the schedule is cleared no longer behaves as a cron job.

To resume, set the same cron schedule again, then redeploy the original deployment from the service's deployment history, or deploy that specific commit. If the old image is no longer stored, the redeploy rebuilds it from the original source revision. The volume and variables belong to the service, not to a single deployment, so the new deployment attaches to the same volume and uses the current variables. Turn autodeploy back on after the service is running again.


Status changed to Awaiting User Response Railway • about 1 month ago


caducamargos12-web
OP

a month ago

Thank you. The reply is marked as an automated AI response. Could a Railway team member please confirm this stop/resume sequence, including that clearing the cron schedule before removing the deployment prevents maintenance or host migrations from starting it again? Please also clarify which variables a history redeploy uses after image retention expires: your reply says current service variables, while https://docs.railway.com/pricing/plans says a rebuild uses the original deployment variables. We need a reliable reversible procedure before making any changes.


Status changed to Awaiting Railway Response Railway • about 1 month ago


Railway
BOT

a month ago

The sequence holds: turn off autodeploy, clear the cron schedule, then remove the remaining deployment. Turning off autodeploy means pushes to the branch no longer create deployments. Clearing the schedule stops all future cron runs right away, but it doesn't stop a container that is already running. That's why removal comes last. Once the deployment is removed, host maintenance and migrations have nothing to move or restart, because they only act on active deployments, not removed ones. None of these steps deletes the service, its volume, its variables or its source settings.

On variables: a redeploy from history uses the service's current variables at the time you redeploy, not a copy saved with the original deployment. That's true whether the old image is reused or rebuilt from the original commit. So to resume with the original configuration, leave the variables unchanged during the pause, or check them before redeploying. The same volume stays attached to the service and is mounted by the new deployment.

To resume: set the cron schedule again, redeploy the original deployment from the service's deployment history (or deploy that commit), then turn autodeploy back on.


Status changed to Awaiting User Response Railway • about 1 month ago


caducamargos12-web
OP

a month ago

We still need a Railway team member to confirm the reversible stop/resume procedure requested above, including the variables used when rebuilding after image retention expires. Please keep this question open for a person to review. We have not changed or removed the service, schedule or deployment based on the automated replies.


Status changed to Awaiting Railway Response Railway • about 1 month ago


Railway
BOT

a month ago

The stop sequence is correct: turn off autodeploy, clear the cron schedule, then remove the deployment. Clearing the schedule stops future scheduled runs. Host migrations skip removed deployments rather than moving them, and scheduled runs only go to an active deployment. None of these steps changes the service's volume, variables or source settings.

One correction to our earlier reply: clearing the schedule does not change how an existing deployment behaves. Removing the deployment is the step that makes sure nothing is left running.

On variables, there are two different actions, and that explains the conflict with the docs. A rollback restores the original deployment's variables, but it only works while that deployment's image is still kept. Once the image expires, rollback is no longer available. A redeploy from history rebuilds from the original source revision when needed, and it always uses the service's current variables at the time you redeploy. After two weeks on Hobby (72-hour image retention), resuming means a redeploy. To get the original configuration back, leave the variables as they are during the pause, or check them before you redeploy. The same volume stays attached to the service and is mounted by the new deployment.

To resume, set the same cron schedule, redeploy the original deployment from the service's deployment history, then turn autodeploy back on.


Status changed to Awaiting User Response Railway • about 1 month ago


Railway
BOT

24 days ago

This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!

Status changed to Solved Railway • 24 days ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...