Start FreeFileSync with cron

Get help for specific problems
Posts: 2
Joined: 23 May 2024

flipflip

Hello everyone,

I am trying to set up the automatic launch of backups on my PC using cron on Fedora 39 with FreeFileSync installed via Flathub.
#crontab -e

DISPLAY=:0
35 07 * * * /usr/bin/flatpak run org.freefilesync.FreeFileSync /home/xxx/Documents/backup-xxx.ffs_batch
In the logs of my PC at the scheduled time for my cron task, I have the following message
mai 23 07:35:01 aaa CROND[6491]: (xxx) CMDOUT (Authorization required, but no authorization protocol specified)
mai 23 07:35:01 aaa CROND[6491]: (xxx) CMDOUT ()
mai 23 07:35:01 aaa CROND[6491]: (xxx) CMDOUT (07:35:01: Error: Unable to initialize GTK+, is DISPLAY set properly?)
mai 23 07:35:01 aaa CROND[6491]: (xxx) CMDEND (/usr/bin/flatpak run org.freefilesync.FreeFileSync /home/xxx/Documents/backup-xxx.ffs_batch)
In the documentation, it is recommended to use gnome-scheduler, but apparently it is no longer maintained and the RPM package is not available for Fedora.

Do you have any suggestions?
Thanks in advance.
Posts: 2
Joined: 23 May 2024

flipflip

Solution
57 08 * * * env DISPLAY=:0 XAUTHORITY=`find /run/user/1000/.mutter*` /usr/bin/flatpak run org.freefilesync.FreeFileSync "/home/xxxx/Documents/backup-xxxx.ffs_batch"
Posts: 959
Joined: 8 May 2006

therube

So it was this "XAUTHORITY" bit.
Something to the effect that you're (setting a variable ?) telling things to run with .mutter's permissions, is that the idea (or at least in a very very broad sense) ?