I'm creating a script to manage my icons and I'm using the command gvfs-set-attribute
in order to do that. The script works fine when I run it with the terminal but it fails to work when I use cron
. Here is a simplified version of my problem:
#!/bin/bash
PATH=/home/myUser/bin:/home/myUser/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/home/myUser/.local/share/gvfs-metadata
gvfs-set-attribute -t string /home/myUser/myFolder metadata::custom-icon file:///home/myUser/myImage.png
I've used crontab -e
and settled my script to run every minute * * * * * /home/myUser/script.bash
. The problem is that this script doesn't work at all when I run it with cron
.
I've already written the PATH
on my script as described in this other issue and the output of the command whereis gvfs-set-attribute
is:
gvfs-set-attribute: /usr/bin/gvfs-set-attribute /usr/share/man/man1/gvfs-set-attribute.1.gz
So, I'm assuming there's nothing wrong with the PATH
here. I've also tried to run my script directly with the absolute path: /usr/bin/gvfs-set-attribute
. But any of those things worked... Does anyone have any idea of what's happening and why I can't use the command gvfs-set-attribute
with cron
?