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

Schedule wkhtmltoimage with cron for a simple recurring job, or use a systemd timer when you want service-unit controls, journal logs, and the option to catch up after missed calendar runs. In either case, use explicit executable and output paths, choose an account that can write the capture file, and test the target website on the Linux host before relying on the schedule.

What to know before scheduling wkhtmltoimage

wkhtmltoimage is a command-line website renderer from the wkhtmltopdf project. Its documented workflow runs headlessly using Qt WebKit, so a virtual display is generally not required. The project repository is archived, and its upstream manual identifies version 0.12.6 with patched Qt; check whether your distribution still packages it and test the exact page with the installed binary. It is a legacy WebKit-based renderer, so do not assume it will correctly render every modern, JavaScript-heavy site. Upstream project repository · Upstream usage manual.

First confirm that the binary can produce the file you need when run manually on the same host and under the same account that will run the scheduled job. Find the installed executable path using your distribution’s package information or shell tools, then use that full path in the schedule. The examples below use /usr/bin/wkhtmltoimage; replace it if the binary is elsewhere.

How to run wkhtmltoimage from cron

A crontab entry has five schedule fields—minute, hour, day of month, month, and day of week—followed by the command. In a per-user crontab, the job runs as that crontab’s owner. System crontabs generally include a username field as well, so use the format appropriate to the file and cron implementation on your Linux distribution. See the Linux crontab manual.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

1. Test the capture and destination

Create the output directory and check that the scheduled account can write there. Then run a manual capture, adapting the URL and paths:

/usr/bin/wkhtmltoimage https://example.org /var/www/captures/example.png

Open or otherwise inspect the resulting image on the host. A successful process exit alone does not establish that the page rendered as intended.

2. Add a recurring entry

For a daily capture at 07:00 in the cron host’s applicable local time, add this line to the appropriate crontab:

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
0 7 * * * /usr/bin/wkhtmltoimage https://example.org /var/www/captures/example.png >> /var/log/site-capture.log 2>&1

This is an illustrative template, not a tested command. Change the URL, binary, output path, schedule, and log location to suit the host. The account needs permission to write both the destination image and, if used, the log file. Cron environments can differ by implementation; specify any required environment rather than relying on an interactive shell’s settings. Some crontab implementations permit setting SHELL and PATH in the crontab; consult the manual for yours. Debian systemd-cron crontab manual.

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.

3. Verify the scheduled run

Check the configured log after the scheduled time and confirm the image file’s timestamp and contents. Cron’s calendar matching uses local time and may skip a nonexistent local time or run twice when daylight-saving time repeats an hour. If that matters, choose a schedule and monitoring approach that accounts for the host’s time-zone behavior. Linux cron manual.

How to create a systemd timer for a screenshot command

A systemd timer activates a corresponding service. Calendar expressions suit wall-clock schedules; monotonic expressions, such as time after boot, suit elapsed-time schedules. The following paired units illustrate a daily calendar capture at 07:00. Adapt the URL, binary, destination, and account; the example has not been tested on your host.

Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

1. Create the service unit

Save this as /etc/systemd/system/site-capture.service:

[Unit]
Description=Capture website screenshot

[Service]
Type=oneshot
User=www-data
ExecStart=/usr/bin/wkhtmltoimage https://example.org /var/www/captures/example.png

Use www-data only if that account exists and is suitable on your system. The selected service account must be able to run the binary and write to the output directory. If the destination directory does not exist, create it and set appropriate ownership and permissions before enabling the timer.

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

2. Create the timer unit

Save this as /etc/systemd/system/site-capture.timer:

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
[Unit]
Description=Run website screenshot daily

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

[Install]
WantedBy=timers.target

Persistent=true applies to calendar timers: when the timer becomes active again after the host was off at a scheduled time, systemd can catch up a missed activation. Check the documentation and behavior for the systemd version installed on your host. systemd.timer manual.

3. Reload, enable, and inspect the timer

After saving both units, run these commands as an administrator:

sudo systemctl daemon-reload
sudo systemctl enable --now site-capture.timer
systemctl list-timers site-capture.timer

The timer listing shows scheduled activations. To inspect the service’s recent output and diagnose a failed run, use:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
sudo journalctl -u site-capture.service

For options and version-specific details, consult the systemd timer documentation and systemd service documentation.

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

Should you use cron or a systemd timer?

Consideration Cron systemd timer
Best fit A host already administered with cron and a straightforward recurring schedule. A systemd host where service-unit controls, timer inspection, or journal diagnostics are useful.
Missed calendar activation Do not assume a missed run will be caught up; behavior depends on the cron setup. Persistent=true can catch up a missed calendar activation when the timer becomes active again.
Logs and diagnostics Redirect output to a log or configure suitable alerting. Inspect service output with the system journal.
Execution identity and environment A per-user crontab runs as its owner; system crontab format and environment depend on implementation. Set a service account in the unit and confirm its permissions and execution environment.
Calendar and time-zone behavior Local-time scheduling can skip or repeat a run during daylight-saving transitions. Calendar scheduling is available; confirm time-zone and version behavior on the host.

Neither scheduler is universally better. Choose based on the tools already supported on the host, how missed runs should be handled, and how you want to manage identity and diagnostics.

Troubleshooting scheduled captures

  • The job works interactively but not on schedule: the scheduled process may have a different account or environment. Use the full binary path, define any required environment, and verify that the cron owner or systemd User can access the URL and destination.
  • No image appears: check the command’s log or service journal, confirm that the output directory exists and is writable, and run the same command manually as the scheduled account.
  • The image is blank, incomplete, or unlike the browser view: test the page with the installed renderer and inspect its output. The legacy Qt WebKit renderer is not guaranteed to handle every modern site or dynamic page correctly; scheduling cannot fix a rendering incompatibility.
  • The run happened at an unexpected time: confirm the host’s time zone and the scheduler’s calendar semantics. Cron local-time schedules can be skipped or repeated during daylight-saving changes.
  • A systemd timer has not run: check systemctl list-timers, confirm both unit files are saved and the manager was reloaded, and inspect journalctl -u site-capture.service for command or permission errors.
  • The command is not found: locate the package’s installed executable and replace the example path with that absolute path.

Or skip the browser setup

If you need a managed capture endpoint instead of maintaining a local renderer and schedule, ScreenshotNeo accepts a URL in one API request and returns an image or PDF. Cookie banners, popups, and chat widgets are removed before capture; bot checks, blank pages, and failed loads are not billed. Its MCP server lets AI agents take screenshots, and 1,000 screenshots per month are free with no card; paid plans start at $5 for 3,000.

For example, this cURL request captures a page as WebP. Replace the URL and API key. See the ScreenshotNeo API documentation for request options 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.org -o shot.webp

Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month with no card.

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.