rasprm3 wrote: ↑
Thu Sep 28, 2017 4:00 pm
They're two completely separate files though, aren't they?
Yes, although it is probably not such a good idea to think of them as "files", as much as a system functionality where each user has his own crontab functionality. Even though they are usually stored as (separate) files, conceptually, there's no reason why it couldn't all be sorted in a single database.
I think the sudo one was the only way I could get an update/upgrade automated before. I was looking into it again but it's been a while.
No, you could just as easily do it by invoking "sudo" from pi's crontab. Opinions vary on whether or not this is a good idea (some here violently believe that it is not and that people who do it are sub-human life forms), but I personally think it is much easier to keep track of things by having it all in the default user's (i.e., pi's) crontab, than having it spread all over the place.
I also think that what you do in crontab should, to as great a degree as is possible, mirror what you do on the command line (i.e., before you decide to crontab it), and since you frequently see people recommending:
Code: Select all
$ sudo apt-get update
$ sudo apt-get upgrade
I.e., with "sudo" on each command line - it then follows that it is more natural to do the same thing when you crontab it.
P.S. It is probably not a good idea to automate the update/upgrade process, tempting as it is to do so...