Short answer: cron is the Linux equivalent of Windows Task Scheduler, and on modern Linux distributions systemd timers are the closer match, because they can also catch up on missed runs and start at boot. On Windows, the equivalent of editing a crontab is the schtasks command or the ScheduledTasks PowerShell module. Below are the same schedules written for all three, so you can translate in either direction.
The same schedule on Linux and Windows
Each row runs backup on the same schedule. On Linux the crontab line goes in crontab -e; on Windows the command is run once in an elevated Command Prompt, and the task then lives in Task Scheduler.
| Schedule | cron (Linux) | schtasks (Windows) |
|---|---|---|
| Every 5 minutes | */5 * * * * /usr/local/bin/backup.sh |
schtasks /create /tn Backup /tr C:\scripts\backup.bat /sc minute /mo 5 |
| Every hour | 0 * * * * /usr/local/bin/backup.sh |
schtasks /create /tn Backup /tr C:\scripts\backup.bat /sc hourly |
| Every day at 09:00 | 0 9 * * * /usr/local/bin/backup.sh |
schtasks /create /tn Backup /tr C:\scripts\backup.bat /sc daily /st 09:00 |
| Weekdays at 09:00 | 0 9 * * 1-5 /usr/local/bin/backup.sh |
schtasks /create /tn Backup /tr C:\scripts\backup.bat /sc weekly /d MON,TUE,WED,THU,FRI /st 09:00 |
| 1st of the month, 02:30 | 30 2 1 * * /usr/local/bin/backup.sh |
schtasks /create /tn Backup /tr C:\scripts\backup.bat /sc monthly /d 1 /st 02:30 |
| At boot | @reboot /usr/local/bin/backup.sh |
schtasks /create /tn Backup /tr C:\scripts\backup.bat /sc onstart /ru SYSTEM |
| At user logon | no cron equivalent | schtasks /create /tn Backup /tr C:\scripts\backup.bat /sc onlogon |
Not sure what a cron line does? Paste it into the cron expression descriptor for a plain-English reading and the next run times.
Managing the tasks
| Job | Linux (cron) | Windows (schtasks) |
|---|---|---|
| List | crontab -l |
schtasks /query /fo LIST /v |
| Edit | crontab -e |
schtasks /change /tn Backup /st 10:00 |
| Run now | run the script by hand | schtasks /run /tn Backup |
| Delete | remove the line in crontab -e |
schtasks /delete /tn Backup /f |
| Run as system | /etc/crontab or root's crontab |
/ru SYSTEM |
| Logs | journalctl -u cron (or /var/log/syslog) |
Task Scheduler → task → History tab |
The same thing in PowerShell
PowerShell's ScheduledTasks module builds the same tasks as objects, which is easier to keep in a script under version control:
$action = New-ScheduledTaskAction -Execute 'powershell.exe' -Argument '-NoProfile -File C:\scripts\backup.ps1'
$trigger = New-ScheduledTaskTrigger -Weekly -DaysOfWeek Monday,Tuesday,Wednesday,Thursday,Friday -At 9am
Register-ScheduledTask -TaskName 'Backup' -Action $action -Trigger $trigger -User 'SYSTEM'
Use -Daily -At 9am for every day, -AtStartup for boot and -AtLogOn for logon. Get-ScheduledTask, Start-ScheduledTask and Unregister-ScheduledTask list, run and delete. To export a task as XML and recreate it on another machine, use Export-ScheduledTask and Register-ScheduledTask -Xml. This is the Windows way to copy a schedule between servers, the way you would copy a crontab.
systemd timers: the modern Linux equivalent
Most current distributions (Ubuntu, Debian, Fedora, RHEL) run systemd, and its timers cover what Task Scheduler does beyond cron. A timer needs two small files:
# /etc/systemd/system/backup.service
[Unit]
Description=Backup
[Service]
Type=oneshot
ExecStart=/usr/local/bin/backup.sh
# /etc/systemd/system/backup.timer
[Unit]
Description=Run backup on weekdays at 09:00
[Timer]
OnCalendar=Mon..Fri 09:00
Persistent=true
[Install]
WantedBy=timers.target
Enable it with sudo systemctl enable --now backup.timer and check it with systemctl list-timers. OnCalendar=*:0/5 runs every 5 minutes, OnBootSec=2min runs shortly after boot, and the output goes to the journal (journalctl -u backup.service) rather than to email.
Persistent=true is the equivalent of Task Scheduler's "Run task as soon as possible after a scheduled start is missed": if the machine was off at 09:00, the job runs when it boots. Plain cron simply skips missed runs; on laptops, anacron was the traditional fix.
What each one does that the other doesn't
| cron | systemd timers | Task Scheduler | |
|---|---|---|---|
| Time schedules | Yes | Yes | Yes |
| Catch up missed runs | No (anacron) | Persistent=true |
Yes, a checkbox |
| At boot | @reboot (most crons) |
OnBootSec= |
onstart |
| At logon, on idle, on an event log entry | No | Partly (user units start at login) | Yes |
| Logging | Mail or syslog | Journal | History tab |
| Config is plain text | Yes | Yes | XML, via export |
Common mistakes
- The job works by hand but not on schedule. Cron runs with a minimal
PATHand no profile, so use full paths to every command and file. On Windows, set the "Start in" folder (or use full paths), because tasks start inC:\Windows\System32. - The Windows task only runs while you are logged in. Choose "Run whether user is logged on or not" (or
/ru SYSTEM), or the task waits for your session. - Time zones. Cron uses the system time zone (some crons let you set
CRON_TZ); Task Scheduler uses local time unless you tick "Synchronize across time zones". - Overlapping runs. Cron starts a new copy even if the last one is still running; wrap the command in
flock -n /tmp/backup.lock. Task Scheduler's default, "Do not start a new instance", already prevents this. - Day-of-month and day-of-week together. In cron,
0 9 1 * 1runs on the 1st and on every Monday, not only on Mondays that fall on the 1st.
FAQ
What is the Linux equivalent of Windows Task Scheduler?
Cron, and on modern distributions systemd timers. Cron covers time-based schedules in one line per job; systemd timers add catching up on missed runs, boot triggers and logging to the journal, which is closer to what Task Scheduler offers.
How do I run a task every 5 minutes on Windows like cron?schtasks /create /tn MyTask /tr C:\path\to\script.bat /sc minute /mo 5. The /mo value is the interval, so /sc hourly /mo 2 runs every two hours. In the Task Scheduler window, the same thing is a daily trigger with "Repeat task every 5 minutes" for a duration of "Indefinitely".
Can I use cron on Windows?
Not natively. Inside WSL you can run cron in the Linux environment, but it only runs while WSL is running, so for anything that must run reliably use Task Scheduler.
Is there a cron equivalent for "run on system startup"?
Most cron implementations support @reboot. With systemd, use OnBootSec= in a timer or enable the service itself with WantedBy=multi-user.target. On Windows it is /sc onstart.
Use the Unix Epoch Timestamp Converter to inspect a timestamp when reviewing dates or schedules. For a related walkthrough, read Cron Expressions: A Complete Guide.