what is the difference between
Why we can't use use only one of this two?
They are completely different things.
systemd is an
init system (replaces the old systemV
init). It extends it in the following ways:
- It unifies the init, login and initscripts, so that different distributions no longer have each its own custom set of scripts to load daemons
- It tracks the services (daemons) so that it has control over them after they start, it can also hold on to the sockets for communitation and start them on demand
- init was ok on the older, more static setups, but with hotplugging, volatile connections, multiseat invariants, systemd is a bit more robust.
- It parallelizes the boot sequence by figuring out the dependencies and starting indepenent things in parallel.
- It knows and controls a lot about your system - init just started the specified scripts and login interface and then did almost nothing until the shutdown. This is one of the things that makes people sceptical - it feels bloated and harder to customize or debug. Anyway - it monitors the processes, tracks changes in the hardware, controls time, locale and power management, mounting of storage and timers. In this respect, you don't strictly need
cronif you are using
systemd. However, it doesn't work the other way around!
So... if you use
init, then you need
cron or something similar to schedule periodic tasks. If you use
systemd, you can still use
cron, but you can also rewrite the rules as
.timer files and let
systemd worry when to start things (instead of relying on a separate daemon).