On the Linux installation page we shared a script that installs the Timber agent on your server. Below is a line-by-line explanation of that script:
- Download the latest version of the Timber Agent into
curl -o /opt/timber-agent.tar.gz https://packages.timber.io/agent/0.6.x/linux-amd64/timber-agent-0.6.x-linux-amd64.tar.gz. We're using
0.6.xas the version number to get the latest patch release in the 0.6 line. You can read more about these special download URLs on the agent versioning page.
- Inside the
/optdirectory, unarchive the release:
cd /opt; tar -xzf timber-agent.tar.gz && rm timber-agent.tar.gz.
- Copy the example configuration to
/etc/timber.tomlto meet your needs. You will need to follow the configuration file syntax. This is where you specify which log files the agent will tail and which Timber applications they will be routed to.
- Copy the default log rotation configuration to
cp /opt/timber-agent/support/scripts/logrotate.d/timber-agent-systemd /etc/logrotate.d/timber-agent. This file will keep the agent's own log file at a small size.
- Copy the startup script for Timber to
cp /opt/timber-agent/support/scripts/startup/systemd/timber-agent.service /etc/systemd/system/.
- Reload the systemd unit file cache:
- Enable the timber-agent unit at startup:
systemctl enable timber-agent. Now, if your machine reboots, the agent will automatically be started as soon as the network and filesystem become available.
- Start the agent immediately:
systemctl start timber-agent. If you don't run this, the agent won't be started until you reboot.