Vlastna Systemd sluzba a casovac
Type=oneshot → Runs the command and does not restart after exit. RemainAfterExit=yes → Marks the service as active even after the script finishes.
[Unit] Description=One-Time Setup Script After=network.target [Service] ExecStart=/usr/local/bin/setup.sh Type=oneshot RemainAfterExit=yes [Install] WantedBy=multi-user.targetType=simple → Assumes the process runs indefinitely in the foreground. Restart=always → If the process crashes, systemd will restart it.
[Unit] Description=Custom Web Server After=network.target [Service] ExecStart=/usr/bin/python3 -m http.server 8080 Restart=always User=www-data WorkingDirectory=/var/www [Install] WantedBy=multi-user.target
[Unit] Description=Daily Backup at 2 AM [Timer] OnCalendar=*-*-* 02:00:00 Unit=dailybackup.service [Install] WantedBy=timers.target
Príspevok pridaný dňa: 17.02.2025 od užívatela: Dodoslav.