platforms / linux / installation / amazon-linux / line-by-line-explanation

Amazon Linux Installation Script Explained

In the Amazon 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:

  1. Downloads the latest version of the Timber Agent into /opt: curl -o /opt/timber-agent.tar.gz https://packages.timber.io/agent/0.5.x/linux-amd64/timber-agent-0.5.x-linux-amd64.tar.gz. We're using 0.5.x as the version number to get the latest patch release in the 0.5 line. You can read more about these special download URLs on the agent versioning page.
  2. Inside the /opt directory, unarchive the release: cd /opt; tar -xzf timber-agent.tar.gz && rm timber-agent.tar.gz.
  3. Copy the example configuration to /etc/timber.toml: /opt/timber-agent/support/config/timber.basic.toml /etc/timber.toml
  4. Edit /etc/timber.toml to 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.
  5. Copy the default log rotation configuration to /etc/logrotate.d/timber-agent: cp /opt/timber-agent/support/scripts/logrotate.d/timber-agent-sysv /etc/logrotate.d/timber-agent. This file will keep the agent's own log file at a small size.
  6. Copy the startup script for Timber to /etc/rc.d/init.d/timber-agent: cp /opt/timber-agent/support/scripts/startup/sysv-epel/timber-agent /etc/rc.d/init.d/.
  7. Enable the startup script: chkconfig --add timber-agent. Now, if your machine reboots, the agent will automatically be started as soon as the network and filesystem become available.
  8. Start the agent immediately: service timber-agent start. If you don't run this, the agent won't be started until you reboot.
Questions?

Chat with us, just click the talk button in the bottom right of this page.

Chat with us
Sign Up

Log better and solve problems faster, today. Install in under a minute.

Sign Up