A scheduled report did not arrive after a server move, or the same batch ran twice on both hosts.
Fastest safe fix: Don’t copy only crontab. Inventory every scheduler, its timezone, permissions, and dependencies; then cut over jobs in batches so only one host is authorized to execute each job. Keep the old environment until critical results, alerting, and rollback conditions are verified.
This guide is for Linux administrators responsible for server migrations and for developers who maintain batch, reconciliation, or data-sync jobs. It also helps CTOs and technical leads confirm that migration scope includes background work, not just the application.
Start the migration by finding every scheduler
Treat the scheduler inventory as a separate workstream from application deployment. A user’s crontab is only one possible source of recurring work. Check each source on the old host and record what you find before editing anything:
- User crontabs for every service account and administrator account.
- System-wide cron configuration, including
/etc/crontaband files under/etc/cron.d/. - Periodic-job directories such as
/etc/cron.hourly,/etc/cron.daily,/etc/cron.weekly, and/etc/cron.monthly. systemdtimer units and the service units they activate.- Application-level schedulers, such as framework-managed jobs or a queue worker that triggers recurring tasks.
- One-time jobs, delayed work, and scripts launched by other services or deployment hooks.
The crontab manual documents user and system crontab formats, including the system crontab’s command-user field. That distinction matters: copying a system entry into a user crontab can change which account runs it, even when the schedule and command look familiar. Ubuntu’s CronHowto also describes common cron locations and troubleshooting checks.
For each entry, identify its owner and its business effect. A cleanup script may be safe to repeat; an invoice export, notification, or database update may not be. Record the evidence that proves the task ran correctly, such as a generated file, a database marker, or an application log—not simply the scheduler’s claim that it started.
| Discovery source | What to inspect | Evidence to capture |
|---|---|---|
| User crontab | Account, schedule, command, redirections | Exported entry and account name |
| System cron | System file or periodic directory, run-as user | Source path and effective user |
systemd timer |
Timer unit, linked service, enablement | Unit files and timer status |
| Application scheduler | Configuration, worker, or control process | Application setting and triggering mechanism |
| One-time or delayed task | Queue, deployment hook, or delayed command | Pending work and responsible owner |
Keep the inventory in a place the migration team can review. A task that no one owns should not silently become an enabled target job. Assign a person to confirm the job’s expected result and to approve its cutover.
Record the execution conditions before rebuilding jobs
A schedule line does not fully describe a job. Its behavior may depend on the account, environment, working directory, filesystem permissions, secrets, database access, and external services. Cron may run with a smaller environment than an interactive shell, so a command that succeeds when pasted into a terminal can still fail when the scheduler launches it.
For every task, capture:
- The source scheduler and exact entry or unit file.
- The user and group that execute it.
- The expected working directory and all command paths.
- Required environment variables, configuration files, and secret sources.
- Input and output files, database permissions, and network endpoints.
- The intended business timezone, not just the host’s configured timezone.
- Whether the job is safe to retry, whether it can overlap with itself, and what it changes.
Check timezones on both systems and compare them with the business requirement. Where a job is intended to run at a particular local time, record that time and the relevant timezone explicitly. Do not infer intent from a host’s current clock setting. Cron and systemd calendar expressions are not interchangeable by appearance alone; the systemd calendar-time documentation describes the format used by timers, while the cron implementation and configuration on the target system determine cron behavior.
For cron entries, inspect the target system’s cron documentation and service status. For timer-based jobs, inspect the timer and its paired service. The systemd.timer manual describes the relationship between timers and services and the Persistent option. That option can trigger a service after a missed calendar event when the timer becomes active again, but it is not a replay queue for every missed interval. Decide whether one catch-up execution is sufficient for the task.
Choose the scheduler that fits the target
A migration does not require changing schedulers. Keep cron if the target supports the current entry and the task does not need timer-specific behavior. Consider a systemd timer when the target service model, logging, or missed-event handling makes it a better fit. In either case, translate and test each job rather than performing a bulk text conversion.
| Target option | Best fit | Check before choosing |
|---|---|---|
| Keep cron | Existing entries are simple, understood, and supported | User context, environment, cron service, and target-specific syntax |
Use a systemd timer |
A job is managed as a service or needs timer-specific behavior | Timer-to-service pairing, calendar expression, enablement, logs, and catch-up expectations |
| Keep an application scheduler | The application already owns recurring work | Worker availability, application configuration, and duplicate scheduler instances |
If you use timers, verify the service unit as well as the timer. The systemd.service manual explains service-unit behavior; it does not make an application command automatically safe to retry. Use systemd-analyze calendar to validate a calendar expression on the target, following the systemd-analyze manual. A distribution’s official guidance can add useful migration details; for example, the SUSE timer guide covers timer operation and cron migration considerations. Verify commands and features against the destination distribution rather than assuming every Linux system behaves identically.
Before enabling a converted timer, confirm that its unit files are in the intended location, that the service runs under the correct account, and that the timer is enabled and active as expected. For cron, confirm that the target daemon is running and that the entry is installed for the intended user. A schedule parser accepting an expression does not validate the command, its permissions, or its business effect.
Test the target environment before cutover
Run representative jobs manually in the target environment before authorizing scheduled execution. Use the intended service account and reproduce the scheduler’s working directory and environment as closely as possible. This step catches command-path errors, missing packages, denied file access, unavailable secrets, and network restrictions before the old host is switched off.
Use this verification sequence for each job:
- [ ] Confirm the command or service unit exists on the target.
- [ ] Run it as the intended account, not as an administrator unless that is the recorded execution context.
- [ ] Check inputs, outputs, database writes, and external calls.
- [ ] Confirm logs and exit status are visible to the people responsible for operations.
- [ ] Verify the target timezone and schedule expression.
- [ ] Define what counts as success and where that evidence will be recorded.
- [ ] Document how to disable the target and restore the old job if validation fails.
Treat side effects as a separate safety check. A successful process exit does not prove that a payment-related action, notification, or data export happened exactly once. For tasks that write data or trigger external actions, check whether the operation is idempotent. If it is not, add an application-level lock, deduplication key, or another control appropriate to that application before allowing overlapping execution.
A job that normally runs infrequently may not complete its full acceptance period during the cutover window. Record the next expected run and assign someone to verify its result afterward. A single successful manual run proves that the command can work under test conditions; it does not prove that every scheduled cycle, input condition, or recovery path is correct.
Cut over in controlled batches and preserve rollback
Move jobs in groups that share an owner or operational dependency, but keep a separate cutover record for every entry. The record should say which host is active, who approved the change, what evidence is required, and what condition triggers rollback. Avoid enabling the old and new schedulers at the same time unless the application has a tested duplicate-prevention mechanism.
For each job, follow this sequence:
- Prepare the target entry in a disabled state and review it with its owner.
- Confirm the target command, credentials, permissions, timezone, and inputs.
- Disable the old entry at the agreed cutover point.
- Enable the target entry and verify its scheduler status and execution logs.
- Check the actual business result, including the expected file, record, or downstream effect.
- If evidence is missing or incorrect, disable the target and follow the documented rollback path.
- Keep the old configuration available until the target has passed the required scheduled checks.
Do not use “the process started” as the only success signal. Check output and business state. For systemd timers, inspect the associated service status and recent logs as well as the timer’s next and previous activation information. For cron, inspect the relevant system logs or configured output path; log locations vary by distribution and configuration. Ubuntu’s CronHowto troubleshooting notes can help diagnose common cron issues, but confirm the applicable logging setup on the actual target.
Keep an explicit active-host field in the migration record. A short note such as “target enabled, old disabled, owner confirmed output” is more useful during an incident than relying on memory or a change ticket that only says “cron migrated.” If a job must remain on the old environment temporarily, mark it as intentionally retained and name the condition for moving or retiring it.
Retire the old host only after task-level acceptance
Before removing the old environment, review the inventory against the target configuration. Confirm that every required task is either running successfully on the target or documented as intentionally remaining elsewhere. Check for old entries that are still enabled, application schedulers that still trigger work, and pending one-time jobs that were not included in recurring-task discovery.
Use a final acceptance review:
- [ ] Every discovered scheduler entry has an owner and a destination status.
- [ ] Critical target jobs have verified outputs, not only start records.
- [ ] No old scheduler remains authorized to perform the same side effect.
- [ ] Rollback conditions and the person responsible for acting on them are documented.
- [ ] Follow-up checks are assigned for jobs whose full cycle did not occur during cutover.
- [ ] Tasks retained on the old host have an owner and a planned review condition.
If stable scheduled workloads are moving to a dedicated server, assess the target as an operating environment, not just a place to copy files. Check the available operating system, CPU and memory fit, storage layout, network options, access method, and the team’s responsibility for monitoring, backups, and recovery. A fixed server does not provide cloud-style automatic scaling; workloads with sharp, unpredictable capacity changes or deep dependencies on managed services may be better left in the cloud or split across a hybrid design.
For an adjacent migration workstream, the guide to moving cloud VM firewall rules to a dedicated server can help the team check network access separately from scheduler behavior. When comparing an independent server as the destination, review the current XFP Cloud server options against the requirements recorded in the migration inventory. Do not treat any server rental as a substitute for a tested task owner, backup plan, or rollback procedure.
Frequently asked questions
A cron job stopped running after the server move. What should I check first?
Confirm that the job exists on the target under the intended user, then check its timezone, command path, working directory, environment, permissions, and required secrets. Run the command manually as that user and inspect the target scheduler’s logs or captured output. Also verify that the job is enabled and that its inputs and network dependencies are reachable.
How can I prevent the old and new servers from running the same job?
Use an explicit cutover record for each job. Disable the old entry before enabling the target, or use an application-level lock or idempotency key if both systems must overlap during a controlled test. Verify the effective schedule on both hosts and confirm the job’s side effects, not just its process exit status.
Should I migrate systemd timers along with cron?
Yes, include them in discovery, but do not convert them automatically. A timer is paired with a service unit and can have calendar, persistence, and activation behavior that differs from a cron entry. Inspect the unit files and test the target schedule. Keep the existing scheduler when it already meets the job’s needs and is supported on the destination.
What happens if the old and new servers use different time zones?
A schedule can run at a different local time when its host timezone changes, and daylight-saving transitions can affect some calendar expressions. Record the intended business timezone for each job, compare the old and target host settings, and validate the expression with the destination scheduler. Do not assume that matching text means matching execution times.
If the current cloud or VPS setup spreads responsibility across multiple scheduler locations, requires separate review of compute, storage, and network charges, or makes the execution environment difficult to keep consistent, a dedicated server may be a better fit for stable jobs your team can operate. It is not the right choice when the workload depends on rapid automatic scaling or services you do not want to manage. Once the job inventory and recovery responsibilities are clear, compare the target requirements with XFP Cloud’s current server options before deciding whether to move.
Questions
A cron job stopped running after the server move. What should I check first?
Confirm that the job exists on the target under the intended user, then check its timezone, command path, working directory, environment, permissions, and required secrets. Run the command manually as that user and inspect the target scheduler's logs or captured output. Also verify that the job is enabled and that its inputs and network dependencies are reachable.
How can I prevent the old and new servers from running the same job?
Use an explicit cutover record for each job. Disable the old entry before enabling the target, or use an application-level lock or idempotency key if both systems must overlap during a controlled test. Verify the effective schedule on both hosts and confirm the job's side effects, not just its process exit status.
Should I migrate systemd timers along with cron?
Yes, include them in discovery, but do not convert them automatically. A timer is paired with a service unit and can have calendar, persistence, and activation behavior that differs from a cron entry. Inspect the unit files and test the target schedule. Keep the existing scheduler when it already meets the job's needs and is supported on the destination.
What happens if the old and new servers use different time zones?
A schedule can run at a different local time when its host timezone changes, and daylight-saving transitions can affect some calendar expressions. Record the intended business timezone for each job, compare the old and target host settings, and validate the expression with the destination scheduler. Do not assume that matching text means matching execution times.
Move Your Scheduled Work to a Dedicated Server
Choose an XFP Cloud physical server in Tokyo and run your Linux workloads on a whole machine.
From $455 / month