In line with the advice that running as root would likely not run with the correct file permissions (and would not read the correct config files), you probably want to run castget as your desktop user. Something like sudo -u mydesktopuser -n -- castget -c
- 0 Posts
- 2 Comments
Joined 3 years ago
Cake day: June 10th, 2023
You are not logged in. If you use a Fediverse account that is able to follow users, you can follow this user.


It would be because cron runs as the root user.
Castget probably looks at the file path $HOME/.castgetrc. For your regular user, $HOME is probably /home/myamazingusername. For the root user, $HOME is probably /root .
You can get a root terminal session by running
sudo -iin a terminal console window. You can try running castget there to see what happens.Sudo -n:
It’s just a nice thing to put in non-interactive scripts that use sudo. Sometimes you can end up with scripts that just wait endlessly for a password that will never be input because the script is being run non-interactively. The flag probably isn’t needed for a cron job, because root probably can sudo as any user without a password, but it doesn’t hurt either.
EDIT: I didn’t know that there are user crontab entries as well. If you just used
crontab -ewithout using sudo, then you don’t need to worry about the job being run as root.