this post was submitted on 12 Oct 2026
27 points (100.0% liked)

Linux

68157 readers
1183 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 7 years ago
MODERATORS
 

Newish to Linux and slowly learning lol. I recently got a podcast downloader working through rss with castget, works great. The command to get new eps that haven't been downloaded is castget -c.

Is there a way to automate this, so the command runs say every day at a set time?

you are viewing a single comment's thread
view the rest of the comments
[–] imminent_nebula@lemmy.ca 2 points 6 days ago (2 children)

I see. I'm the only user and the .castgetrc file that I edit for the RSS feeds is located in home. The castget command works in terminal when I type it, but it may not if cron does it? Would that be because cron installs as root? I'm on Cachyos and had to install cronie as cron wasn't preinstalled. If it doesn't work I'll try your suggestion.

I know -u is for user, what is -n -- in this case?

[–] vole@lemmy.world 3 points 6 days ago* (last edited 6 days ago) (1 children)

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 -i in a terminal console window. You can try running castget there to see what happens.

Sudo -n:

-n, --non-interactive
  Avoid prompting the user for input of any kind.  If a
  password is required for the command to run, sudo, will
  display an error message and exit.

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 -e without using sudo, then you don't need to worry about the job being run as root.

[–] imminent_nebula@lemmy.ca 2 points 6 days ago

This was really interesting, thanks. Something I'll keep in mind for sure, but I did set it up with crontab -e so maybe I'm all good. Gonna play around with it some more over the next few days, there's so much to learn. Linux is amazing

[–] Filetternavn@lemmy.blahaj.zone 2 points 6 days ago (1 children)

If you ever have a question about what a specific flag does for a command, type man [insert command here] and RTFM (respectfully, of course). If you need a shorthand that's less verbose, most commands have a --help or -h flag that prints out a quick overview of how to use the command and what the flags do.

[–] imminent_nebula@lemmy.ca 1 points 6 days ago

Excellent thank you