Zum Hauptinhalt springen
Support
0
Kontaktieren Sie uns
English
Nederlands
Español
Dedicated ServersFlexible VPSCloud-TechnologieColocationHerausforderungen in der ITSektorenCareers
Cloud Compute

Mit Cloud Compute haben Sie jederzeit und überall Zugriff auf ein Portal, über das Sie Ihre gesamte IT-Umgebung konfigurieren können – egal wo auf der Welt Sie sich befinden.

Cloud-Speicher

Zuverlässiger Zugriff auf Ihre Dateien, Infrastruktur und Anwendungen zu jeder Zeit – ganz ohne Unterbrechungen oder Verzögerungen. Bei Worldstream bieten wir eine Vielzahl von Speicherlösungen an.

Flexible cloud icon
Flexible Cloud
Private cloud icon
Private Cloud
Bare metal icon
Bare Metal Compute
Hollow cube icon
Objektspeicher
Hollow cube icon
Dateiablage
Block storage icon
Blockspeicher
Backup storage icon
Sicherungsspeicher
Brauchen Sie Unterstützung?

Mit erfahrenen Technikern und einer durchschnittlichen Reaktionszeit von 7 Minuten erhalten Sie innerhalb kürzester Zeit eine solide technische Supportlösung.

Dedicated Server

Wählen Sie jetzt Ihren Dedicated Server. Individuelle oder Instant Delivery. Leistungsstarke Server, die perfekt zu Ihrem Anwendungsfall passen.

Use Cases

Ganz gleich, welcher Use Case – wir helfen Ihnen, die ideale Lösung zu finden.

Deal servers icon
Deals
AMD servers icon
AMD-Prozessoren
AI servers icon
Intel-Prozessoren
Hollow cube icon
Virtualisierung, Containerisierung & Orchestrierung
Hollow cube icon
Websites & Applications
Hollow cube icon
Gaming & Streaming Infrastruktur
Brauchen Sie Unterstützung?

Mit erfahrenen Technikern und einer durchschnittlichen Reaktionszeit von 7 Minuten erhalten Sie innerhalb kürzester Zeit eine solide technische Supportlösung.

Smartes Outsourcing

Bestimmte IT-Lösungen generieren Mehrwert, andere erfüllen eher eine unterstützende Funktion. Denken Sie beim Outsourcing daran.

Kosteneffizienz

IT-Komplettpakete mögen erstmal wie eine sichere Option erscheinen, doch wenn man sich die Kosten genau anschaut, sind andere Lösungen oft sinnvoller.

IT-Flexibilität und Kontrolle

Outsourcing heißt nicht, dass man die Kontrolle verliert; man bekommt sogar mehr Flexibilität und Kontrolle.

Cloud-Repatriierung

Die Cloud ist kein Endziel: Sie sollten Ihre Cloud-Umgebung kontinuierlich prüfen und an die sich ändernden Anforderungen anpassen.

Finanzdienstleistungen
Logistik und Transport
Einzelhandel und E-commerce
Medien und Unterhaltung
Technik und Softwareentwicklung
Sicherheit
Managed Service Provider
Brauchen Sie Unterstützung?

Mit erfahrenen Technikern und einer durchschnittlichen Reaktionszeit von 7 Minuten erhalten Sie innerhalb kürzester Zeit eine solide technische Supportlösung.

Chatten Sie mit unsKontaktieren Sie uns
Über WorldstreamÜber die TechnologieKundenfälleWissensdatenbank
Über unsLernen Sie unser Team kennenJobsWerden Sie WiederverkäuferZertifizierungenUnsere RechenzentrenUnser NetzwerkDDoS-SchutzAMD EPYC-ServerTechnologiepartnerBetriebssystemeAlle KundenfälleEasyTerraDutch Drone CompanyPerfGridArtikelFAQNachrichten und BlogbeiträgeProdukte und Services
Kontaktieren Sie uns

Rufen Sie an unter +31 (0) 174 – 712 117 Industriestraat 53, Naaldwijk

English
Nederlands
Español
0
Dedicated ServersFlexible VPSCloud-TechnologieColocationHerausforderungen in der ITSektorenCareersÜber WorldstreamÜber die TechnologieKundenfälleWissensdatenbankMy Worldstream
Contact
Support
EnglishNederlandsEspañol
  1. HomeHome
  2. Knowledge Base
  3. Dedicated Servers
  4. Cron jobs: scheduling recurring tasks on a Linux server

Cron jobs: scheduling recurring tasks on a Linux server

Gilt für Linux servers, VPS and dedicatedZielgruppe Sysadmin, developerZuletzt geprüft September 2026

Kort antwoord

Cron runs commands on a schedule you define with five time fields plus the command itself. Edit your own schedule with crontab -e, or drop a file into /etc/cron.d/ for system-wide jobs. The most common failure mode isn't a bad schedule, it's a script that only works when you run it by hand, because cron gives it almost none of your normal shell environment.

Auf dieser Seite
  • The five fields
  • Real examples
  • Editing your crontab
  • Where cron jobs silently fail
  • Make failures visible

The five fields

A crontab line has five time fields, in this order, followed by the command to run:

FieldAllowed valuesMeaning
Minute0-59Minute of the hour
Hour0-23Hour of the day, 24-hour clock
Day of month1-31Day of the month
Month1-12Month of the year
Day of week0-7 (0 and 7 both mean Sunday)Day of the week

An asterisk (*) means "every value" for that field. A slash sets a step, so */15 in the minute field means every 15 minutes. A comma lists specific values, and a hyphen sets a range.

Real examples

These are complete, working crontab lines. The path to the script is deliberately absolute, more on why below.

# Run a backup script every day at 3:00am
0 3 * * * /opt/scripts/backup.sh

# Run a health check every 15 minutes
*/15 * * * * /opt/scripts/check.sh

# Run a report on the first day of every month at 6:00am
0 6 1 * * /opt/scripts/monthly-report.sh

Editing your crontab

1

Per-user crontab

Run crontab -e as the user whose schedule you want to change. This opens the crontab in your default editor. Jobs added here run as that user, with that user's permissions.

2

Listing and removing

Run crontab -l to print the current user's crontab without opening an editor, and crontab -r to remove it entirely. Be careful with crontab -r: it deletes the whole crontab immediately, without asking for confirmation, so take a copy first with crontab -l > crontab.bak.

3

System-wide jobs

For jobs that shouldn't belong to a single user's crontab, place a file in /etc/cron.d/. The format is almost the same, but each line needs an extra field naming the user to run the command as:

0 3 * * * root /opt/scripts/backup.sh

This is also the more discoverable option in configuration management, since the file lives under version control alongside the rest of your server setup rather than inside a per-user crontab that's easy to forget about.

Where cron jobs silently fail

A script that runs perfectly when you type it at your own terminal can still fail under cron. The reason is almost always environment, not logic.

  • Minimal environment. Cron does not run a login shell, so the shell profile files that normally set up your PATH, environment variables, and aliases never run. A script that calls python3 or node and relies on your shell's PATH to find them may simply not find them under cron.
  • Different working directory. Cron jobs typically start in the home directory of the user running them, not wherever you happened to be sitting when you tested the script manually. A script using a relative path like ./data.csv will look in the wrong place.
  • No assumptions about environment variables. Anything your script depends on, such as an API key or a config path normally exported in your shell, needs to be set explicitly inside the script or the crontab entry, not assumed to already exist.

The fix for most of this is the same: use absolute paths everywhere, for the script itself, for any files it reads or writes, and for any binaries it calls. Don't assume a variable is set just because it always is when you run the script by hand.

Make failures visible

By default, cron only emails a job's output to the local mail account, which on most servers nobody is reading. A failed job can go unnoticed for weeks unless you build in a way to see it. The simplest habit is redirecting output to a log file:

0 3 * * * /opt/scripts/backup.sh >> /var/log/backup.log 2>&1

The 2>&1 sends error output to the same place as standard output, so both successes and failures land in one file you can check, or feed into a monitoring check. Without this, cron failures are silent by default, the job simply doesn't run correctly and nothing tells you.

Related articles

  • Common API automation recipes
  • Monitoring
  • Dedicated Servers overview
War dieser Artikel hilfreich?

Solide IT. Keine Überraschungen

Sparringspartner für IT-Reife
Wir räumen die Hindernisse aus dem Weg, damit Sie freie Bahn haben
Vorhersehbare und transparente Kosten

Kontakt

  • Industriestraat 53, Naaldwijk
  • Zahlungsmöglichkeiten
  • Missbrauch
  • Ressourcen für Entwickler
  • Network Operations Center
  • Über uns
  • Lernen Sie unser Team kennen
  • Jobs
  • Werden Sie Wiederverkäufer
  • Zertifizierungen
  • Unsere Rechenzentren
  • Unser Netzwerk
  • DDoS-Schutz
  • AMD EPYC-Server
  • Technologiepartner
  • Betriebssysteme
  • Übersicht
  • FAQ
  • Kundenfälle
  • Nachrichten und Blogbeiträge
  • Use Cases
English
Nederlands
Español
English
Nederlands
Español
  • Rechtliches
  • Transparenzhinweis