Article 5HMG4 Anacrontab Questions

Anacrontab Questions

by
matthewlawson3
from LinuxQuestions.org on (#5HMG4)
Hi! I am trying to have my Raspberry Pi 4b on Raspberry Pi OS do an update of the repository list and update the software on the computer automatically once a week. It is not on 24/7 so I'm trying to use anacron for the first time. Below is what is in the anacrontab file currently. The 45 minute delay is just to make sure there are no conflicts. I have a few questions.

1. When I made the new line (the 4th entry) and saved it I was running as root. Do I need to add sudo to the commands or is it okay? Shouldn't think so.

2. Do I need to add START_HOURS_RANGE and RANDOM_DELAY variables? They were not in the anacrontab to start with. If so, where should I put them?

3. How do I check to see if it is running correctly? I used anacron -T -t anacrontab and it returned nothing, just the prompt.

4. Is the job ID something I create as I have done or should it be something else?

Thanks for your help!

# /etc/anacrontab: configuration file for anacron

# See anacron(8) and anacrontab(5) for details.

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
HOME=/root
LOGNAME=root

# These replace cron's entries
1 5 cron.daily run-parts --report /etc/cron.daily
7 10 cron.weekly run-parts --report /etc/cron.weekly
@monthly 15 cron.monthly run-parts --report /etc/cron.monthly
7 45 updateandupgrade.weekly apt update && apt upgrade -ylatest?d=yIl2AUoC8zA latest?i=asW5_Fh6NiI:zeB9dftVAaU:F7zBnMy latest?i=asW5_Fh6NiI:zeB9dftVAaU:V_sGLiP latest?d=qj6IDK7rITs latest?i=asW5_Fh6NiI:zeB9dftVAaU:gIN9vFwasW5_Fh6NiI
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments