Command to add systemd service for charm instance: bob systemd.
If it exists, ask to override or remove.
Will add timer if not exists (/etc/systemd/system/charm.timer):
[Unit]
Description=Run Charm Framework cron services every minute
[Timer]
OnCalendar=*:*:0/1
Persistent=true
[Install]
WantedBy=timers.target
Will add target if not exists (/etc/systemd/system/charm.target):
[Unit]
Description=Charm Framework cron target
Will add service for specific instance if not exists (/etc/systemd/system/charm-$name.service):
[Unit]
Description=Charm Demo Website Cronjob
[Service]
User=project-user
Group=user-group
ExecStart=/path/to/php $path cron:run
And link and activate it:
# Add timer
sudo systemctl daemon-reload
sudo systemctl enable charm.timer
sudo systemctl start charm.timer
# Add service
sudo systemctl enable charm-$name.service --now
sudo systemctl add-wants charm.target charm-$name.service
# Enable target
sudo systemctl enable charm.target
Command to add systemd service for charm instance:
bob systemd.If it exists, ask to override or remove.
Will add timer if not exists (
/etc/systemd/system/charm.timer):Will add target if not exists (
/etc/systemd/system/charm.target):Will add service for specific instance if not exists (
/etc/systemd/system/charm-$name.service):And link and activate it: