I have this cron job that suppose to be running twice a week and it doesn’t:
0 10 * * 1,4 hyprctl -i 0 dispatch 'hl.dsp.exec_cmd("~/.config/MyScripts/allupdates.sh", { workspace = "2" }) >> ~/Documents/cronlog 2>&1'
I tried making simpler, like this one that is working:
0 9 * * 0 hyprctl -i 0 dispatch 'hl.dsp.exec_cmd("~/.config/MyScripts/backups.sh >> ~/Documents/cronlog 2>&1")'
Updates script works perfectly when executed from the shell.
Here is the updates script:
#!/bin/bash
# set -euo pipefail
upd () {
notify-send -u normal -i /usr/share/icons/cachyos.svg "SCHEDULED SYSTEM UPDATE" "$1"
kitty -e bash -c "$2" | bat -p
wait $last_pid
}
upd "Updating AppImage packages..." 'am -u'
upd "Updating Flatpak packages..." 'flatpak update'
upd "Updating Pacman packages..." 'sudo pacman -Syu'
upd "Updating AUR packages..." 'paru -Sua'
upd "Removing orphaned packages..." "sudo pacman -Rns $(pacman -Qtdq)"
upd "Updating Hyprland plugins..." "hyprpm update"
upd "All updates are finished!"
Thank you for the help!