This article describes the process of creating a script that will automatically update your Datto Linux Agent (DLA). Follow this workflow on each of your protected Linux servers to keep the Linux agent certificate on the protected endpoint up-to-date.
- Datto Linux Agent
- Script creation
- Cron job creation
- Service restart
This article assumes you have basic knowledge of the Linux command line and have root-level access to your Linux system via a command-line interface. For assistance with creating an auto-update script for the Datto Linux Agent, contact Datto Technical Support.
The Datto Linux Agent installs updates through the Linux distribution's package management system, rather than through a DLA command, so each distribution type will need a slightly different command to perform the update. You can put these commands into a script that is called by a cron job (external link). The cron job will automatically run the update script each day.
Use the following steps to create a script.
- Create the script file (all distros).
You can create the script in whatever directory you would like to keep it in. For this example, we will use root's home directory, but you can replace the path to suit your own installation needs.
chmod +x ~/dla_update.sh
- Enter the script file contents.
Cut and paste the appropriate block into the
~/dla_update.shfile you just created.
For Debian/Ubuntu systems
apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 370C85D709D26407
bash -c "echo 'deb [arch=amd64] https://cpkg.datto.com/datto-deb/public/$(lsb_release -sc) $(lsb_release -sc) main' > /etc/apt/sources.list.d/datto-linux-agent.list"
apt-get install dlad
For Red Hat/CentOS systems
yum update dlad
For OpenSUSE/SLE systems
zypper install dlad
For Fedora systems
dnf install dlad
Cron job creation (all distros)
To create the cron job that will run the script, follow the steps below.
1. Run the following command as root.
2. Add the line below to create a cron job that will run the update every day at midnight.
0 0 * * * ~/dla_update.sh
3. Save and exit the editor.
4. You can view the new crontab file to confirm that the new job is in place by running:
To activate the new cron job, restart the cron service according to your Linux distribution's init system type. To determine your init system type, check the documentation for your specific Linux distribution.
service cron restart
systemctl restart crond.service