October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk6 min

How to Schedule Website Screenshots on a Linux Server with systemd Timers

Use a systemd timer to run a headless Playwright screenshot script on a Linux server, and learn how to verify, schedule, and troubleshoot the job.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use a systemd .timer unit to activate a matching .service, and let that one-shot service run a browser script that saves the screenshot to an absolute path. For a daily 2 a.m. capture, the example below uses Playwright in headless Chromium, a calendar timer, and Persistent=true for a limited catch-up when the timer was inactive. Replace the account, paths, URL, and schedule for your server.

How the timer and screenshot service fit together

systemd timers schedule units rather than running browser code themselves. A timer named site-screenshot.timer activates site-screenshot.service by default because the unit names share a base name. The service is Type=oneshot: it starts the capture script and finishes when that process exits.

As an Amazon Associate I earn from qualifying purchases.

This separates the schedule from the browser work. You can change when captures run without embedding scheduling logic in the script, and you can run or inspect the service independently when diagnosing problems.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Install the browser and prepare stable paths

Install Playwright and its Chromium build

Install Playwright in the project environment using its official setup instructions, then install the browser build and Linux dependencies compatible with that Playwright version. The Playwright browser guide documents npx playwright install --with-deps chromium for installing Chromium and dependencies on supported Linux environments: Playwright browser management. If you upgrade Playwright, install the browser binaries matching the new version as well.

#1 Best Overall
CanaKit Raspberry Pi 5 Starter Kit PRO - Turbine Black (128GB Edition) (8GB RAM)
  • Includes Raspberry Pi 5 with 2.4Ghz 64-bit quad-core CPU (8GB RAM)
  • Includes 128GB Micro SD Card pre-loaded with 64-bit Raspberry Pi OS, USB MicroSD Card Reader
  • CanaKit Turbine Black Case for the Raspberry Pi 5
  • CanaKit Low Noise Bearing System Fan
  • Mega Heat Sink - Black Anodized

Playwright runs browsers headless by default, so a server without a desktop can usually run the capture directly. A headed Linux browser needs a display server such as Xvfb; use that only if the job specifically needs headed operation.

Choose the service account and output directory

Create the project and output directories, and ensure the service account can read the script and write the output. The example uses screenshot as the account and /var/lib/site-screenshot for the image; those names are examples, not required system paths. Use absolute executable, script, and screenshot paths. Playwright resolves a relative screenshot path from the process’s current working directory, which may differ from an interactive shell’s directory.

Create the capture script

Save this as /opt/site-screenshot/capture.js after installing the playwright package in the execution environment:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
const { chromium } = require('playwright');

(async () => {
  const browser = await chromium.launch();
  try {
    const page = await browser.newPage();
    await page.goto('https://example.com');
    await page.screenshot({
      path: '/var/lib/site-screenshot/latest.png',
      fullPage: true
    });
  } finally {
    await browser.close();
  }
})();

The example navigates to one URL, captures the full page, and closes Chromium even if capture work fails. For a viewport-only image, omit fullPage: true. Playwright’s Page API documents navigation and screenshot options at Page API.

Before scheduling, run the script as the same Unix account the service will use and confirm that the output file is created. This exposes missing browser dependencies, incorrect permissions, or a bad path before those failures become unattended timer runs.

Rank #2
CanaKit Raspberry Pi 5 16GB Starter Kit PRO - Turbine Black (128GB Edition) (16GB RAM)
  • Includes Raspberry Pi 5 16GB with 2.4Ghz 64-bit quad-core CPU (16GB RAM)
  • Includes 128GB Micro SD Card pre-loaded with 64-bit Raspberry Pi OS, USB MicroSD Card Reader
  • CanaKit Turbine Black Case for the Raspberry Pi 5
  • CanaKit Low Noise Bearing System Fan
  • Mega Heat Sink - Black Anodized

Define the systemd service and timer

Service unit

Create /etc/systemd/system/site-screenshot.service:

[Unit]
Description=Capture a website screenshot

[Service]
Type=oneshot
User=screenshot
WorkingDirectory=/opt/site-screenshot
ExecStart=/usr/bin/node /opt/site-screenshot/capture.js

Adjust User, WorkingDirectory, and ExecStart to match the account, project location, and Node.js executable on your host. If Node.js or the browser package is managed through a per-user version manager, systemd may not inherit the interactive shell’s modified PATH; use the actual executable path and provide any required environment explicitly.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Timer unit

Create /etc/systemd/system/site-screenshot.timer:

[Unit]
Description=Schedule website screenshots

[Timer]
OnCalendar=*-*-* 02:00:00
Persistent=true

[Install]
WantedBy=timers.target

OnCalendar=*-*-* 02:00:00 means a daily wall-clock run at 02:00 in the host’s local time zone. Check the proposed expression on the target server with systemd-analyze calendar '*-*-* 02:00:00'; calendar parsing and supported features can depend on the installed systemd version.

Choose the schedule and missed-run behavior

Wall-clock schedule or interval

Use OnCalendar= when the requirement is tied to a civil time, such as every day at 02:00 or a particular weekday. Timer units also support monotonic scheduling, which is based on elapsed time rather than a wall-clock appointment. Choose according to whether the capture should occur at a named clock time or after an interval; do not treat those schedule types as interchangeable.

What Persistent=true does

With a calendar timer, Persistent=true records when the service was last triggered and can cause one activation when the timer starts again if an eligible calendar event elapsed while it was inactive. It is useful when a server was powered down or the timer was stopped at the scheduled time, but it does not replay every missed daily occurrence. Omit it if missed captures should simply be skipped.

Rank #3
CanaKit Raspberry Pi 5 Essentials Starter Kit (4GB RAM)
  • CanaKit Raspberry Pi 5 Essentials Starter Kit

Timing is not exact to the second

A timer expiration is not a guarantee that the service begins at the exact configured instant. AccuracySec= allows a timing window; the installed systemd documentation describes the default behavior for that version. Current upstream documentation also describes ordering calendar timers after time-setting and time-synchronization targets so a timer does not fire against an unset clock. Host configuration and systemd version affect the details. See systemd.timer and systemd.time.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Load, enable, and verify the timer

  1. Reload unit definitions: sudo systemctl daemon-reload.

  2. Check the calendar expression on the server: systemd-analyze calendar '*-*-* 02:00:00'.

  3. Enable the timer at boot and start it now: sudo systemctl enable --now site-screenshot.timer.

  4. Inspect its next and previous trigger information: systemctl list-timers site-screenshot.timer.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
    Rank #4
    SANOOV Raspberry Pi 5 4GB Kit, 4GB RAM Single Board Computer with Active Cooler and ABS Case, Complete Raspberry Pi 5 Starter Kit for IoT Robotics Retro Gaming
    • All-in-One Complete Kit: This SANOOV RPi 5 bundle comes with Raspberry Pi 5 4GB RAM single board, active cooler, durable ABS case and screwdriver. No extra parts needed, ready to use right out of the box for beginners and hobbyists
    • Powerful Single Board Computer: Equipped with 4GB RAM and high-performance processor, delivers fast running speed for 4K playback, AI projects, programming and daily computing tasks. SANOOV for raspberry pi 5 4GB is equipped with broadcom 64 quad-core Arm Cortex A76 processor with gigabit ethernet and upgraded with IEEE 802.11ac Wi-Fi, Bluetooth 5.0 dual-band 2.4Ghz and 5Ghz and Power Over Ethernet (POE). Upgrading delivers 2-3 x speed vs Pi 4, redefining the experience
    • Efficient Active Cooler: Effectively lowers operating temperature and prevents performance throttling. Runs quietly even under long-time heavy load, ensures stable operation all day long. SANOOV RPi 5 4GB kit offer an active cooler, which combines an aluminium heatsink with a high-performance PWM fan. Active cooler is fully compatible with the Pi OS, which can effectively reduce the temperature of RPi5 and ensure its good performance during long-term high load operation
    • Sturdy ABS Protective Case: Well-fitted for Raspberry Pi 5 board, can be secured with 4 screws to effectively protect the Pi 5 motherboard from damage, reserves full access to all ports and buttons. SANOOV uses ABS material to produce the case, which has a softer texture and feel. Meanwhile, SANOOV case adopts a layered design for easy disassembly and installation. (Tip: The Case cannot install M.2 HAT Add on Board and Solid State Drive!)
    • Wide Application & Full Compatibility: Seamlessly compatible with official OS and mainstream peripheral accessories for Raspberry Pi 5. Whether you are a beginner, student, electronics hobbyist or professional developer, this all-in-one kit meets your diverse needs. It excels in IoT projects, robotics design, retro gaming devices, home media servers and other DIY creations. Backed by a large global community, you can easily find guides, technical support and shared projects online
  5. Run the service immediately for a manual test: sudo systemctl start site-screenshot.service.

  6. Check the service result and recent output: systemctl status site-screenshot.service and journalctl -u site-screenshot.service.

Timer and service names must match the files you installed. Commands and unit locations shown here are typical systemd administration; verify them against the distribution and installed systemd version on the target host.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Keep captures useful and comparable

Set the viewport, browser version, host image, fonts, and capture settings consistently if you compare screenshots over time. Rendering can vary with host operating system, browser version, settings, hardware, power source, and headless mode, so a changed image is not necessarily evidence that the website changed. Playwright discusses these sources of variation in its visual comparisons guidance.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Full-page capture can include content beyond the initial viewport, but lazy-loaded images may not appear unless the page has loaded them before capture. If that matters, use a deliberate page-loading strategy and validate its result on the target site rather than assuming navigation alone loads every off-screen asset. Keep output naming intentional: overwriting latest.png preserves only the newest capture; timestamped names preserve a history but require a retention policy so the output directory does not grow indefinitely.

Best Value
RasTech Raspberry Pi 5 8GB Kit with Active Cooler and Pi5 Case
  • 【What you Get】You will get 1*Pi 5 8GB Single Board,1*RasTech Case,1*Active Cooler,1*Screwdriver,1*Installation instructions,12-month free warranty, lifetime service, 24-hour prompt and friendly response.
  • 【More Connectors】There are two USB 3.0 ports(5Gbps simultaneously) and two USB 2.0 ports, which triple total bandwidth ,support any combination of up to two cameras or displays. Peak SD card performance is doubled through support for the SDR104 high-speed mode. It provides a smooth desktop experience for you. Offer Gigabit Ethernet and a PCIe interface, along with dual-band Wi-Fi and Bluetooth 5.0/BLE wireless capability. The RasTech Pi 5 Kit use the new 27W 5.1V 5A USB-C power connector.
  • 【 Support Dual 4Kp60 Display 】Each of the two microHDMI sockets can control a 4K display at 60 Hertz, now support HDR, offering super HD video for media streaming projects. RPi 5 is the first RPi model that comes with a PCI Express port (PCIe 2.0 x1 with 500 MB/s) to attach SSDs (requires separate M.2 HAT).
  • 【 Excellent Chips And Applications】Pi 5 is a full-size Pi computer using silicon built in-house at Pi. The RP1 “southbridge” provides the bulk of the I/O capabilities for Pi 5. Pi 5 is more friendly and convenient in the development of Internet of Things, Web development, machine identification, automatic control and other electronic equipment applications and network.
  • 【 Faster CPU, Better GPU 】 Pi 5 features a Broadcom BCM2712 64-bit quad-core Arm Cortex-A76 processor running at 2.4GHz, it delivers a 2–3× increase in CPU performance relative to RaspberryPi 4. The 800MHz VideoCore VII GPU is compatible to OpenGL ES 3.1 and Vulkan 1.2, substantial uplift in graphics performance. Pi 5 Offers lightning-fast CPU speed, a PCI Express interface, a Real Time Clock (RTC) and a power button and runs significantly cooler than Pi 4.

Troubleshoot common failures

  • The timer does not appear or has no next run: confirm the unit file names, run sudo systemctl daemon-reload, check systemctl status site-screenshot.timer, and validate the calendar expression with systemd-analyze calendar.

  • The timer ran but no screenshot was saved: inspect systemctl status site-screenshot.service and journalctl -u site-screenshot.service. Confirm the service account can write the output directory and that the script’s screenshot path is absolute and correct.

  • It works in a shell but fails under systemd: the unit does not necessarily inherit your shell’s current directory, environment, or version-manager path. Set WorkingDirectory=, use absolute paths, and explicitly configure any required environment.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Chromium fails to launch: install the browser binaries that match the installed Playwright package and the Linux dependencies. Re-run the documented browser installation after Playwright upgrades; read the service journal for the specific missing library or executable.

  • The service runs at an unexpected local time: check the host time zone and clock synchronization, then inspect the parsed expression and the timer’s next trigger. Calendar timers use wall-clock scheduling, whose interpretation depends on system time configuration.

  • The image differs between runs: stabilize the operating system image, browser build, fonts, viewport, and headless configuration. Dynamic site content can also change independently of the capture setup.

Or skip the browser setup

Instead of maintaining a Linux browser installation and systemd capture script, a scheduled task can call ScreenshotNeo’s screenshot API. For example, save this cURL command in a script and schedule that script with the timer above; the returned image is written to shot.webp. See the ScreenshotNeo API documentation for parameters and response details.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp

ScreenshotNeo accepts cookie and consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each of those steps can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers report page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents. The Free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots.

Sign up for ScreenshotNeo: get 1,000 screenshots a month free with no card.

Quick Recap

Bestseller No. 1
CanaKit Raspberry Pi 5 Starter Kit PRO - Turbine Black (128GB Edition) (8GB RAM)
CanaKit Raspberry Pi 5 Starter Kit PRO - Turbine Black (128GB Edition) (8GB RAM)
Includes Raspberry Pi 5 with 2.4Ghz 64-bit quad-core CPU (8GB RAM); CanaKit Turbine Black Case for the Raspberry Pi 5
$259.95
Bestseller No. 2
CanaKit Raspberry Pi 5 16GB Starter Kit PRO - Turbine Black (128GB Edition) (16GB RAM)
CanaKit Raspberry Pi 5 16GB Starter Kit PRO - Turbine Black (128GB Edition) (16GB RAM)
Includes Raspberry Pi 5 16GB with 2.4Ghz 64-bit quad-core CPU (16GB RAM); CanaKit Turbine Black Case for the Raspberry Pi 5
$419.99
Bestseller No. 3
CanaKit Raspberry Pi 5 Essentials Starter Kit (4GB RAM)
CanaKit Raspberry Pi 5 Essentials Starter Kit (4GB RAM)
CanaKit Raspberry Pi 5 Essentials Starter Kit
$189.99

Learn more about ScreenshotNeo.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.