FreeFileSync with Cron + Wayland

Get help for specific problems

cometchaserde

Hi,

I run a FreeFileSync-Batchjob with cron and the following command

/opt/FreeFileSync/FreeFileSync /home/stefan/FreeFileSync/BatchRun-Downloads.ffs_batch --display=:0.0

on Debian Bookworm with Gnome and X.org.

After switching to Wayland, the Batchjob doesn't work anymore.
The job gets executed by cron but nothing happens. No log file from FreeFilesync gets generated.
Wenn I run the command from a shell
eg. /opt/FreeFileSync/FreeFileSync /home/stefan/FreeFileSync/BatchRun-Downloads.ffs_batch --display=:0.0
it works.

Changing the cron command to
/opt/FreeFileSync/FreeFileSync /home/stefan/FreeFileSync/BatchRun-Downloads.ffs_batch
doesn't work.

Switching back to X.org it works.

Any ideas ?

Thank you,
Stefan
Posts: 1
Joined: 12 Feb 2026

jasmines

Same issue here.
Did anyone get it fixed?
Posts: 8
Joined: 14 Apr 2016

john the hat

No help here but this may become more urgent as Ubuntu 26.* no longer provides X.org support.

log error:
Authorization required, but no authorization protocol specified
Authorization required, but no authorization protocol specified
11:43:01: Error: Unable to initialize GTK+, is DISPLAY set properly?

I am REASONABLY confident this is a Wayland problem but so far it is beyond me :-(
Posts: 8
Joined: 14 Apr 2016

john the hat

If anyone else is having this problem I think I have a work-round. You need to run FFS batch file through a script, calling said script from cron.

A typical script would read:

#!/usr/bin/bash
export XDG_RUNTIME_DIR=/run/user/$(id -u) #you may not need this and it may do nothing but on my system it is needed.
export WEYLAND_DISPLAY=:0
/opt/FreeFileSync/FreeFileSync /home/absolute address to sfncfile.ffs_batch > /home/absolute address to logfile.log 2>&1


saved as syncfile.sh and set to run as program.

The example cron line would read:

#Syncfile
45 16 * * * /home/absolute address to syncfile.sh
Posts: 16
Joined: 12 Mar 2026

keith7465

I have a simple cron job which runs the script below, and takes a parameter of the particular FFS file to use. I don't know if this is under Wayland or not - how would I tell? Ubuntu 26.04 LTS.

#!/bin/bash

FFS="/opt/FreeFileSync/FreeFileSync"
FFS_DIR="/home/keith/.ffsync"
LOG="$FFS_DIR/ffslog.log"
JOB="$FFS_DIR/$1"

export HOME="/home/keith"
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

[[ -f "$Log" ]] && mv "$Log" "$Log".old

echo "=========================================================================" >> "$LOG"
echo "$(date '+%m/%d %T'): Starting FFS run for $1" >> "$LOG"

if [[ ! -f "$JOB" ]]; then
echo "$(date '+%m/%d %T'): ERROR: Batch file not found: $JOB" >> "$LOG"
exit 1
fi

# FreeFileSync is GTK-based, so give it a private virtual X display.
xvfb-run -a -s "-screen 0 1920x1080x24" \
"$FFS" "$JOB" >> "$LOG" 2>&1

RESULT=$?

echo "$(date '+%m/%d %T'): FFS run for $1 ended with exit code $RESULT" >> "$LOG"
echo "=========================================================================" >> "$LOG"

exit $RESULT