-
To update a beszel-agent I currently login to the client system and issue
Is it possible to update the agent from the beszel dashboard? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Not currently. This would be difficult to implement because people are running it on different operating systems, with different configurations, different permissions, etc. I'd recommend using a cron job or systemd timer to check for updates and restart the service if needed. I will add this functionality to the binary install script in the near future. Option 1: Cron JobCreate a cron job to check for updates daily and only restart Open the crontab editor: crontab -e Add the following cron job: 0 2 * * * /opt/beszel-agent/beszel-agent update | grep -q "Successfully updated" && systemctl restart beszel-agent Option 2: Systemd Timer and ServiceCompared to cron, systemd provides more control and makes it easier to monitor update attempts via systemd logs. Create a systemd service unit file for the update process. Create the file [Unit]
Description=Update beszel-agent if needed
Wants=beszel-agent.service
[Service]
Type=oneshot
ExecStart=/bin/bash -c '/opt/beszel-agent/beszel-agent update | grep -q "Successfully updated" && systemctl restart beszel-agent' Create a systemd timer unit file to run the update daily. Create the file [Unit]
Description=Run beszel-agent update daily
[Timer]
OnCalendar=daily
Persistent=true
RandomizedDelaySec=4h
[Install]
WantedBy=timers.target Enable and start the timer: sudo systemctl enable beszel-agent-update.timer
sudo systemctl start beszel-agent-update.timer Verify that the timer is active: systemctl list-timers beszel-agent-update.timer |
Beta Was this translation helpful? Give feedback.
-
Thank you very much for the detailed answer. I was expecting something like this. I like beszel very much 👍 Keep up the good work! |
Beta Was this translation helpful? Give feedback.
-
No worries, glad you find it useful. I'll convert this to a discussion in case anyone else is wondering about this. In the next release I'll update the install script to ask the user if they want to enable automatic daily updates. |
Beta Was this translation helpful? Give feedback.
Not currently. This would be difficult to implement because people are running it on different operating systems, with different configurations, different permissions, etc.
I'd recommend using a cron job or systemd timer to check for updates and restart the service if needed. I will add this functionality to the binary install script in the near future.
Option 1: Cron Job
Create a cron job to check for updates daily and only restart
beszel-agent
if the update output contains "Successfully updated".Open the crontab editor:
Add the following cron job:
Option 2: Syst…