Files

207 lines
13 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 680 460" width="680" height="460" role="img">
<title>cron vs timers systemd : comparaison des capacités</title>
<desc>Comparaison visuelle en deux colonnes entre cron (à gauche) et les timers systemd (à droite). Chaque ligne représente une capacité de planification : syntaxe d'horaire, rattrapage des jobs ratés, logging, dépendances, jitter, limites de ressources, vue consolidée. La colonne cron coche les bases, la colonne systemd coche toutes les capacités.</desc>
<!-- Background -->
<rect width="680" height="460" fill="#fafaf7"/>
<!-- Background grid -->
<g opacity="0.06">
<line x1="0" y1="100" x2="680" y2="100" stroke="#888" stroke-width="0.5"/>
<line x1="0" y1="200" x2="680" y2="200" stroke="#888" stroke-width="0.5"/>
<line x1="0" y1="300" x2="680" y2="300" stroke="#888" stroke-width="0.5"/>
<line x1="0" y1="400" x2="680" y2="400" stroke="#888" stroke-width="0.5"/>
</g>
<!-- ===== HEADERS ===== -->
<!-- cron column header -->
<g transform="translate(40, 30)">
<rect width="270" height="55" rx="6" fill="#f0eee8" stroke="#666" stroke-width="1"/>
<!-- Old clock icon -->
<circle cx="32" cy="27" r="16" fill="#fff" stroke="#666" stroke-width="1.5"/>
<line x1="32" y1="27" x2="32" y2="17" stroke="#666" stroke-width="1.5" stroke-linecap="round"/>
<line x1="32" y1="27" x2="40" y2="30" stroke="#666" stroke-width="1.5" stroke-linecap="round"/>
<circle cx="32" cy="27" r="1.5" fill="#666"/>
<text x="60" y="22" font-family="system-ui, sans-serif" font-size="14" fill="#333" font-weight="500">cron</text>
<text x="60" y="40" font-family="ui-monospace, monospace" font-size="9" fill="#888">depuis 1975 — simple, partout</text>
</g>
<!-- systemd column header -->
<g transform="translate(370, 30)">
<rect width="270" height="55" rx="6" fill="#d9ecdf" stroke="#3b8a4f" stroke-width="1"/>
<!-- Modern gear icon -->
<g transform="translate(32, 27)">
<circle r="14" fill="#fff" stroke="#3b8a4f" stroke-width="1.5"/>
<circle r="5" fill="none" stroke="#3b8a4f" stroke-width="1.5"/>
<g stroke="#3b8a4f" stroke-width="1.5" stroke-linecap="round">
<line x1="0" y1="-14" x2="0" y2="-10"/>
<line x1="0" y1="14" x2="0" y2="10"/>
<line x1="-14" y1="0" x2="-10" y2="0"/>
<line x1="14" y1="0" x2="10" y2="0"/>
<line x1="-10" y1="-10" x2="-7" y2="-7"/>
<line x1="10" y1="10" x2="7" y2="7"/>
<line x1="-10" y1="10" x2="-7" y2="7"/>
<line x1="10" y1="-10" x2="7" y2="-7"/>
</g>
</g>
<text x="60" y="22" font-family="system-ui, sans-serif" font-size="14" fill="#1f4a2a" font-weight="500">systemd timer</text>
<text x="60" y="40" font-family="ui-monospace, monospace" font-size="9" fill="#3b6a44">intégré, déclaratif, observable</text>
</g>
<!-- ===== CAPABILITY LABELS (center column) ===== -->
<text x="340" y="115" text-anchor="middle" font-family="ui-monospace, monospace" font-size="10" fill="#666" font-weight="500">syntaxe d'horaire</text>
<text x="340" y="150" text-anchor="middle" font-family="ui-monospace, monospace" font-size="10" fill="#666" font-weight="500">rattrapage si éteint</text>
<text x="340" y="185" text-anchor="middle" font-family="ui-monospace, monospace" font-size="10" fill="#666" font-weight="500">logs intégrés</text>
<text x="340" y="220" text-anchor="middle" font-family="ui-monospace, monospace" font-size="10" fill="#666" font-weight="500">dépendances</text>
<text x="340" y="255" text-anchor="middle" font-family="ui-monospace, monospace" font-size="10" fill="#666" font-weight="500">jitter (anti pics)</text>
<text x="340" y="290" text-anchor="middle" font-family="ui-monospace, monospace" font-size="10" fill="#666" font-weight="500">limites cgroups</text>
<text x="340" y="325" text-anchor="middle" font-family="ui-monospace, monospace" font-size="10" fill="#666" font-weight="500">vue consolidée</text>
<text x="340" y="360" text-anchor="middle" font-family="ui-monospace, monospace" font-size="10" fill="#666" font-weight="500">fuseaux horaires</text>
<text x="340" y="395" text-anchor="middle" font-family="ui-monospace, monospace" font-size="10" fill="#666" font-weight="500">portabilité (BSD, Alpine)</text>
<!-- ===== ROWS ===== -->
<!-- Helper: cron column row centers -->
<!-- All rows: cron block at x=40 (270 wide), systemd at x=370 (270 wide) -->
<!-- Each row: feature label centered at x=340, indicator on left/right -->
<!-- Row 1: syntax -->
<!-- cron: limited (yellow/warn) -->
<g transform="translate(40, 105)">
<rect width="270" height="20" rx="3" fill="#f5e4cd" stroke="#c98030" stroke-width="0.8"/>
<polygon points="12,15 18,4 24,15" fill="#c98030"/>
<text x="18" y="14" text-anchor="middle" font-family="system-ui, sans-serif" font-size="9" fill="#fff" font-weight="500">!</text>
<text x="34" y="14" font-family="ui-monospace, monospace" font-size="9" fill="#7a4a14">0 2 * * * (cryptique)</text>
</g>
<g transform="translate(370, 105)">
<rect width="270" height="20" rx="3" fill="#d9ecdf" stroke="#3b8a4f" stroke-width="0.8"/>
<circle cx="18" cy="10" r="6" fill="#3b8a4f"/>
<path d="M 14 10 L 17 13 L 22 7" stroke="#fff" stroke-width="1.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/>
<text x="34" y="14" font-family="ui-monospace, monospace" font-size="9" fill="#1f4a2a">OnCalendar=Mon..Fri 02:00</text>
</g>
<!-- Row 2: catch-up -->
<g transform="translate(40, 140)">
<rect width="270" height="20" rx="3" fill="#efd3cf" stroke="#a8312a" stroke-width="0.8"/>
<circle cx="18" cy="10" r="6" fill="#a8312a"/>
<line x1="14" y1="6" x2="22" y2="14" stroke="#fff" stroke-width="1.5" stroke-linecap="round"/>
<line x1="22" y1="6" x2="14" y2="14" stroke="#fff" stroke-width="1.5" stroke-linecap="round"/>
<text x="34" y="14" font-family="ui-monospace, monospace" font-size="9" fill="#6b1e18">job sauté en silence</text>
</g>
<g transform="translate(370, 140)">
<rect width="270" height="20" rx="3" fill="#d9ecdf" stroke="#3b8a4f" stroke-width="0.8"/>
<circle cx="18" cy="10" r="6" fill="#3b8a4f"/>
<path d="M 14 10 L 17 13 L 22 7" stroke="#fff" stroke-width="1.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/>
<text x="34" y="14" font-family="ui-monospace, monospace" font-size="9" fill="#1f4a2a">Persistent=true</text>
</g>
<!-- Row 3: logging -->
<g transform="translate(40, 175)">
<rect width="270" height="20" rx="3" fill="#f5e4cd" stroke="#c98030" stroke-width="0.8"/>
<polygon points="12,15 18,4 24,15" fill="#c98030"/>
<text x="18" y="14" text-anchor="middle" font-family="system-ui, sans-serif" font-size="9" fill="#fff" font-weight="500">!</text>
<text x="34" y="14" font-family="ui-monospace, monospace" font-size="9" fill="#7a4a14">mail ou redirection manuelle</text>
</g>
<g transform="translate(370, 175)">
<rect width="270" height="20" rx="3" fill="#d9ecdf" stroke="#3b8a4f" stroke-width="0.8"/>
<circle cx="18" cy="10" r="6" fill="#3b8a4f"/>
<path d="M 14 10 L 17 13 L 22 7" stroke="#fff" stroke-width="1.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/>
<text x="34" y="14" font-family="ui-monospace, monospace" font-size="9" fill="#1f4a2a">journalctl -u nom.service</text>
</g>
<!-- Row 4: dependencies -->
<g transform="translate(40, 210)">
<rect width="270" height="20" rx="3" fill="#efd3cf" stroke="#a8312a" stroke-width="0.8"/>
<circle cx="18" cy="10" r="6" fill="#a8312a"/>
<line x1="14" y1="6" x2="22" y2="14" stroke="#fff" stroke-width="1.5" stroke-linecap="round"/>
<line x1="22" y1="6" x2="14" y2="14" stroke="#fff" stroke-width="1.5" stroke-linecap="round"/>
<text x="34" y="14" font-family="ui-monospace, monospace" font-size="9" fill="#6b1e18">aucune (sleep + boucle)</text>
</g>
<g transform="translate(370, 210)">
<rect width="270" height="20" rx="3" fill="#d9ecdf" stroke="#3b8a4f" stroke-width="0.8"/>
<circle cx="18" cy="10" r="6" fill="#3b8a4f"/>
<path d="M 14 10 L 17 13 L 22 7" stroke="#fff" stroke-width="1.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/>
<text x="34" y="14" font-family="ui-monospace, monospace" font-size="9" fill="#1f4a2a">After=network-online.target</text>
</g>
<!-- Row 5: jitter -->
<g transform="translate(40, 245)">
<rect width="270" height="20" rx="3" fill="#efd3cf" stroke="#a8312a" stroke-width="0.8"/>
<circle cx="18" cy="10" r="6" fill="#a8312a"/>
<line x1="14" y1="6" x2="22" y2="14" stroke="#fff" stroke-width="1.5" stroke-linecap="round"/>
<line x1="22" y1="6" x2="14" y2="14" stroke="#fff" stroke-width="1.5" stroke-linecap="round"/>
<text x="34" y="14" font-family="ui-monospace, monospace" font-size="9" fill="#6b1e18">sleep $((RANDOM % N))</text>
</g>
<g transform="translate(370, 245)">
<rect width="270" height="20" rx="3" fill="#d9ecdf" stroke="#3b8a4f" stroke-width="0.8"/>
<circle cx="18" cy="10" r="6" fill="#3b8a4f"/>
<path d="M 14 10 L 17 13 L 22 7" stroke="#fff" stroke-width="1.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/>
<text x="34" y="14" font-family="ui-monospace, monospace" font-size="9" fill="#1f4a2a">RandomizedDelaySec=15min</text>
</g>
<!-- Row 6: cgroups -->
<g transform="translate(40, 280)">
<rect width="270" height="20" rx="3" fill="#efd3cf" stroke="#a8312a" stroke-width="0.8"/>
<circle cx="18" cy="10" r="6" fill="#a8312a"/>
<line x1="14" y1="6" x2="22" y2="14" stroke="#fff" stroke-width="1.5" stroke-linecap="round"/>
<line x1="22" y1="6" x2="14" y2="14" stroke="#fff" stroke-width="1.5" stroke-linecap="round"/>
<text x="34" y="14" font-family="ui-monospace, monospace" font-size="9" fill="#6b1e18">nice + ionice au mieux</text>
</g>
<g transform="translate(370, 280)">
<rect width="270" height="20" rx="3" fill="#d9ecdf" stroke="#3b8a4f" stroke-width="0.8"/>
<circle cx="18" cy="10" r="6" fill="#3b8a4f"/>
<path d="M 14 10 L 17 13 L 22 7" stroke="#fff" stroke-width="1.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/>
<text x="34" y="14" font-family="ui-monospace, monospace" font-size="9" fill="#1f4a2a">CPUQuota=50% MemoryMax=1G</text>
</g>
<!-- Row 7: consolidated view -->
<g transform="translate(40, 315)">
<rect width="270" height="20" rx="3" fill="#efd3cf" stroke="#a8312a" stroke-width="0.8"/>
<circle cx="18" cy="10" r="6" fill="#a8312a"/>
<line x1="14" y1="6" x2="22" y2="14" stroke="#fff" stroke-width="1.5" stroke-linecap="round"/>
<line x1="22" y1="6" x2="14" y2="14" stroke="#fff" stroke-width="1.5" stroke-linecap="round"/>
<text x="34" y="14" font-family="ui-monospace, monospace" font-size="9" fill="#6b1e18">cron.d, cron.daily, users…</text>
</g>
<g transform="translate(370, 315)">
<rect width="270" height="20" rx="3" fill="#d9ecdf" stroke="#3b8a4f" stroke-width="0.8"/>
<circle cx="18" cy="10" r="6" fill="#3b8a4f"/>
<path d="M 14 10 L 17 13 L 22 7" stroke="#fff" stroke-width="1.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/>
<text x="34" y="14" font-family="ui-monospace, monospace" font-size="9" fill="#1f4a2a">systemctl list-timers</text>
</g>
<!-- Row 8: timezones -->
<g transform="translate(40, 350)">
<rect width="270" height="20" rx="3" fill="#efd3cf" stroke="#a8312a" stroke-width="0.8"/>
<circle cx="18" cy="10" r="6" fill="#a8312a"/>
<line x1="14" y1="6" x2="22" y2="14" stroke="#fff" stroke-width="1.5" stroke-linecap="round"/>
<line x1="22" y1="6" x2="14" y2="14" stroke="#fff" stroke-width="1.5" stroke-linecap="round"/>
<text x="34" y="14" font-family="ui-monospace, monospace" font-size="9" fill="#6b1e18">fuseau système uniquement</text>
</g>
<g transform="translate(370, 350)">
<rect width="270" height="20" rx="3" fill="#d9ecdf" stroke="#3b8a4f" stroke-width="0.8"/>
<circle cx="18" cy="10" r="6" fill="#3b8a4f"/>
<path d="M 14 10 L 17 13 L 22 7" stroke="#fff" stroke-width="1.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/>
<text x="34" y="14" font-family="ui-monospace, monospace" font-size="9" fill="#1f4a2a">09:00:00 Europe/Paris</text>
</g>
<!-- Row 9: portability — cron WINS here -->
<g transform="translate(40, 385)">
<rect width="270" height="20" rx="3" fill="#d9ecdf" stroke="#3b8a4f" stroke-width="0.8"/>
<circle cx="18" cy="10" r="6" fill="#3b8a4f"/>
<path d="M 14 10 L 17 13 L 22 7" stroke="#fff" stroke-width="1.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/>
<text x="34" y="14" font-family="ui-monospace, monospace" font-size="9" fill="#1f4a2a">BSD, macOS, conteneurs</text>
</g>
<g transform="translate(370, 385)">
<rect width="270" height="20" rx="3" fill="#efd3cf" stroke="#a8312a" stroke-width="0.8"/>
<circle cx="18" cy="10" r="6" fill="#a8312a"/>
<line x1="14" y1="6" x2="22" y2="14" stroke="#fff" stroke-width="1.5" stroke-linecap="round"/>
<line x1="22" y1="6" x2="14" y2="14" stroke="#fff" stroke-width="1.5" stroke-linecap="round"/>
<text x="34" y="14" font-family="ui-monospace, monospace" font-size="9" fill="#6b1e18">Linux systemd uniquement</text>
</g>
<!-- ===== Bottom verdict ===== -->
<rect x="40" y="420" width="600" height="28" rx="6" fill="#f0eee8" stroke="#666" stroke-width="0.8"/>
<text x="340" y="438" text-anchor="middle" font-family="system-ui, sans-serif" font-size="11" fill="#444" font-style="italic">cron pour la simplicité et la portabilité — systemd dès que la tâche devient critique</text>
</svg>