I'm kinda new in Linux and I've just learned about scheduling tasks with cron. I have this small shell script that I've been using manually till now:
sudo apt-get check && sudo apt-get update && sudo apt-get upgrade && sudo apt-get autoremove && sudo apt-get autoclean
Now I want to schedule it using cron so I won't manually do it every day, but it seems I can not do so. I suppose it is because it requires my sudo password in order to proceed? Is there any way I can make this work without auto-accepting the upgrades and so on?
15 21 * * * root sysup && echo "Succes!"
Still, I had no such message displayed on my terminal. Any thoughts why? Not sure what I'm doing wrong. I was expecting that the output of the scheduled task still appear on terminal, prompting me when required input.
– Alexandru Banu Jun 08 '17 at 22:24sudo chmod +x /usr/local/bin/sysupat the end you can put your commands directly in/etc/crontabto make sure thy really work. – Ravexina Jun 08 '17 at 22:27