No Sound Notification when Run from Crontab in Linux Mint

Get help for specific problems
Posts: 3
Joined: 4 Aug 2025

FreeFileJRC

Just updated to the latest version for Linux. I run a sync daily using a script in the Linux crontab scheduler. The sync runs as normal and shows the Completed Successfully window, but it does not play the notification sound for Synchronization Finished. It does play this sound if I run the sync manually from within the FreeFileSync program, but not when the crontab scheduler runs. Did not have this issue until after today's version update. Thank you
Posts: 346
Joined: 7 Jan 2018

bgstack15

Can you do me a favor: However you run FreeFileSync normally, can you please run a terminal and this command:
$ env
DBUS_SESSION_BUS_ADDRESS=unix:path=/tmp/dbus-oZRvIMPVfI,guid=dcaeed05f6b54b6edd42176768825290
This will show you all the environment variables. Chances are you are running a distribution that uses dbus, and you need to export the environment variable for your cron job of the current dbus user session. Mine is seen in the example above.
That will be different for every time you log in. I expect we could write a script that will search for the existing user session, find a running process from that, extract its environment variable for DBUS_SESSION_BUS_ADDRESS, and then export it before running FFS from cron.
Posts: 3
Joined: 4 Aug 2025

FreeFileJRC

Thank you so much for your fast response. I'm not a technical person, and I'm fairly new to Linux. Sorry I forgot to mention that I am running Linux Mint Cinnamon. Below is a partial excerpt from running the above terminal command, with the DBUS section at the bottom. I hope this helps, and please let me know if you need more. Thank you!


DG_CURRENT_DESKTOP=X-Cinnamon
VTE_VERSION=6800
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
GNOME_TERMINAL_SCREEN=/org/gnome/Terminal/screen/8fb1ee43_6fcb_4b3f_8d61_fdd71aa4253f
LESSCLOSE=/usr/bin/lesspipe %s %s
XDG_SESSION_CLASS=user
TERM=xterm-256color
LESSOPEN=| /usr/bin/lesspipe %s
USER=john
GNOME_TERMINAL_SERVICE=:1.166
DISPLAY=:0
SHLVL=1
XDG_VTNR=7
XDG_SESSION_ID=c2
XDG_RUNTIME_DIR=/run/user/1000
GTK3_MODULES=xapp-gtk3-module
XDG_DATA_DIRS=/usr/share/cinnamon:/usr/share/gnome:/home/john/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
GDMSESSION=cinnamon
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
_=/usr/bin/env
Posts: 346
Joined: 7 Jan 2018

bgstack15

So what we would want to do is find something that is running that is part of Cinnamon, that would always be running. I suppose we also need to know if you want this cron job to always make a sound, even if your computer is just at a login screen (that is, when you are not logged in). That might be harder. But for making sounds when you are already logged in, that should be easier with that DBUS_SESSION_BUS_ADDRESS.

And all this is a guess, that dbus somehow is responsible for sound. I'm not the most versed in playing sounds.

Perhaps the first thing to try though is to run this, from cron (from https://wiki.archlinux.org/title/PulseAudio?useskin=vector#Play_sound_from_a_non-interactive_shell_(systemd_service,_cron))
machinectl shell --uid=<YOUR_USERNAME> .host /opt/FreeFileSync/FreeFileSync
Fix up the username, and also the path to FreeFileSync. Perhaps this will load the correct environment variables for you, so I don't have to write a general solution shell script that find some running Cinnamon process and reads its environment variables. If we have to do that, we'll also need XDG_DATA_DIRS.
Posts: 3
Joined: 4 Aug 2025

FreeFileJRC

Thank you once again. I tried running the above but it did not work, but I might not have done it correctly. While I greatly appreciate your help, I guess this is not that big of a deal to not hear a sound, so I do not want to risk messing things up with my lack of experience running these scripts in the terminal. (To address your question, I also do not need to hear a sound when I am not logged in). Thank you once again but I will drop this issue, and maybe the next upgrade will fix it (as mentioned before, this was not an issue until the latest upgrade). Best to you