Linux
View all Worklets
LinuxLinux

Set Timezone

Updates the /etc/localtime symlink to configure Linux endpoint timezone settings

Worklet Details

What the timezone configuration Worklet does

This Automox Worklet™ configures the system timezone on Linux endpoints by updating the /etc/localtime symbolic link to point to the correct timezone file within the /usr/share/zoneinfo directory structure. The Worklet performs validation checks to confirm that the /etc/localtime symlink exists, verifies the current timezone setting, and only updates the link if it does not already point to the target timezone location.

The Worklet is configured with a specific timezone path (for example, /usr/share/zoneinfo/America/Chicago) and systematically validates each step before making changes to the endpoint's system configuration. This conservative approach minimizes the risk of unintended timezone modifications.

You can customize the target timezone by modifying the Worklet policy before deployment, selecting any valid timezone from the /usr/share/zoneinfo directory. The Worklet includes built-in commands to help you discover all available timezone options on your system. Common timezone selections include UTC for server deployments, regional timezones like America/New_York or Europe/London for user-facing systems, and specialized configurations for multi-region deployments.

Why standardize Linux timezone configuration

Inconsistent timezone settings across your Linux infrastructure create operational and security challenges. System logs from endpoints in different timezones become difficult to correlate, creating gaps in your security monitoring and incident response capabilities. When log timestamps don't align with your organization's actual local time, troubleshooting becomes time-consuming and error-prone.

Cron jobs, scheduled tasks, and automated processes depend on accurate system time. Misaligned timezones can cause jobs to execute at unexpected times or fail to run when expected. Compliance frameworks like CIS Benchmarks recommend standardizing system timezone configuration across all endpoints to maintain audit trail consistency and maintain proper time synchronization across your infrastructure.

Automating timezone configuration through Automox eliminates manual configuration drift and keeps all Linux endpoints maintain the correct timezone regardless of how many systems you manage. This approach reduces the administrative overhead of managing timezone settings on individual systems and provides a consistent baseline for your IT operations team.

Timezone misalignment can trigger subtle but serious problems in your infrastructure. Database replication across regions fails when timestamp synchronization is broken. Backup and restore operations produce inconsistent data when system clocks disagree on the time. Log analysis tools struggle with events that appear to happen in the wrong order due to timezone differences. By standardizing timezone configuration, you eliminate these hidden operational risks and create a reliable foundation for your automation and security operations.

How timezone configuration works

  1. Evaluation phase: The Worklet checks whether the /etc/localtime symlink exists on the endpoint, reads the current target of the symlink using the readlink command, and compares it against the intended timezone path. If the symlink already points to the correct timezone file, the Worklet exits without making changes. If the symlink is missing or points to a different timezone, the evaluation indicates that remediation is needed.

  2. Remediation phase: If the timezone configuration is incorrect, the Worklet verifies that the target timezone file exists within /usr/share/zoneinfo, then removes the existing /etc/localtime symlink and creates a new one that points to the correct timezone location. After updating the symlink, the system immediately applies the new timezone setting, affecting all subsequent operations and log entries.

Linux timezone configuration requirements

  • Linux endpoint running any standard distribution (Ubuntu, CentOS, Debian, RedHat, etc.)

  • Root or sudo privileges required to modify system symlinks in /etc

  • Valid timezone file must exist in /usr/share/zoneinfo (standard on all Linux distributions)

  • Bash shell availability to execute the evaluation and remediation scripts

  • Custom timezone path configured in the Worklet policy before deployment

Expected timezone configuration state

After successful execution of the Worklet, your Linux endpoints will have the /etc/localtime symlink correctly updated to point to your configured timezone. All subsequent date and time operations on the endpoint, including system logs, cron jobs, and application timestamps, will reflect the new timezone setting. You can verify successful configuration by running the date command on your endpoint to confirm it displays the correct local time.

Subsequent executions of the Worklet will recognize that the timezone is already correctly configured and skip remediation, maintaining your desired timezone setting across ongoing operations. Your system logs will now display timestamps consistent with your organization's timezone, enabling accurate correlation of events across your Linux infrastructure and improving your security monitoring and incident response capabilities.

How to validate set timezone changes

  1. Run this Worklet on a pilot Linux endpoint and review evaluation output for set timezone.

  2. Confirm Automox activity logs show successful completion and exit code 0.

  3. Verify endpoint state using checks aligned to evaluation script logic, such as exit.

  4. Validate remediation effects from script operations such as rm, ln, then rerun evaluation for compliance.

View in app
evalutation image
remediation image

Consider Worklets your easy button

What's a Worklet?

A Worklet is an automation script, written in Bash or PowerShell, designed for seamless execution on endpoints – at scale – within the Automox platform. Worklet automation scripts perform configuration, remediation, and the installation or removal of applications and settings across Windows, macOS, and Linux.

do more with worklets