怎样在Linux系统中安装和配置Systemd和Crontab
在Linux系统中安装和配置Systemd和Crontab的步骤以下:
sudo apt-get install systemdsudo yum install systemdmy-service.service:sudo nano /etc/systemd/system/my-service.service[Unit]
Description=My Service
After=network.target
[Service]
ExecStart=/path/to/my-service
Type=simple
[Install]
WantedBy=multi-user.target/path/to/my-service替换为您要运行的实际服务的路径。sudo systemctl start my-service
sudo systemctl enable my-servicesudo apt-get install cronsudo yum install croniecrontab -e/path/to/my-script.sh:0 8 * * * /path/to/my-script.shsudo systemctl restart cron现在,您已在Linux系统中成功安装和配置了Systemd和Crontab。
TOP