Code: Select all
sudo crontab -e
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.
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 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.
Code: Select all
$ sudo apt-get update $ sudo apt-get upgrade $
Well... That dependos. If you want to run a cron job that requires root permissions, putting it in the root crontab would certainly be a logical choice. I use it for (for instance) changing the backlight setting on an RPF display.
This I wouldn't mind knowing a little more about. Can you tell me or point me in the direction of how that works please? You just add files in a folder and cronjobs will run from those?
My method may not be "approved", but it isn't actually "wrong" as it works. Like many things in *nix, there are multiple ways of accomplishing this, even if some may be preferred over others. At best, you should have said "not the generally recognized as preferable method."DougieLawson wrote: ↑Thu Sep 28, 2017 5:15 pmBzzzt! Wrong.
Put a file with a crontab line (single part name, no qualifiers) in /etc/cron.d