Vaakkux
Posts: 12
Joined: Tue Sep 11, 2018 11:25 am
Location: UK

Crontab issues on Raspberry Pi 4 with Buster

Tue Jul 16, 2019 10:00 am

Hi there

I've been working on a personal project that involves making changes to the crontab.
In stretch I am able to edit the crontab as pi user (crontab -e) and successfully enable a file to run on startup, I am also able to do the same as root user (sudo crontab -e) for the same file.

However, I am currently unable to edit the crontab as pi user in Buster. As root user, I can successfully edit the crontab. but the pi user crontab doesn't appear to allow for editing.

Any help is appreciated.

pcmanbob
Posts: 6681
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Crontab issues on Raspberry Pi 4 with Buster

Tue Jul 16, 2019 10:28 am

Seems to work just fine on my pi4B running buster lite.

added this line to pi user cron using crontab -e

Code: Select all

1-59/2 * * * * date >> /home/pi/test.txt 2>&1
produces a text file in /home/pi as expected containing the output of the date command

Code: Select all

Tue 16 Jul 11:25:01 BST 2019
Tue 16 Jul 11:27:01 BST 2019
Edit
same test on buster with full desktop works exactly the same, accessed via ssh.

So what changes have you made to your pi OS that might have affected this ?

might also help if you show us a screen shot of any error messages or your crontab not working.
Last edited by pcmanbob on Tue Jul 16, 2019 11:15 am, edited 2 times in total.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

User avatar
RaTTuS
Posts: 10415
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: Crontab issues on Raspberry Pi 4 with Buster

Tue Jul 16, 2019 10:51 am

^WHS
crontab -e
sudo crontab -e
crontab -l
sudo crontab -l
all works as expected

[raspbian lite]
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

SimonBlake
Posts: 11
Joined: Fri Feb 13, 2015 4:33 pm

Re: Crontab issues on Raspberry Pi 4 with Buster

Tue Jul 16, 2019 2:18 pm

I thought I was suffering this problem too - the editor never seemed to completely load the cron file.

But it does - it's simply that the ordering of the list of potential editors has changed. Previously, selecting option 2 gave you nano, but now option 1 gives you nano, and option 2 is vim.tiny. If you're used to nano and you try vim, it (not surprisingly) behaves differently.

To select your favourite editor again, simply run select-editor to choose again.

Simon

Vaakkux
Posts: 12
Joined: Tue Sep 11, 2018 11:25 am
Location: UK

Re: Crontab issues on Raspberry Pi 4 with Buster

Tue Jul 16, 2019 3:02 pm

SimonBlake wrote:
Tue Jul 16, 2019 2:18 pm
I thought I was suffering this problem too - the editor never seemed to completely load the cron file.

But it does - it's simply that the ordering of the list of potential editors has changed. Previously, selecting option 2 gave you nano, but now option 1 gives you nano, and option 2 is vim.tiny. If you're used to nano and you try vim, it (not surprisingly) behaves differently.

To select your favorite editor again, simply run select-editor to choose again.

Simon
Hi Simon,

I'm using the Vim editor to make the change I need, which appears to be its default.

After making the change I attempt to exit, as you would in the nano editor, however it then comes up with ' press qa:! to exit and delete all the changes. I'm not very experienced using Vim so is there a cmd to exist it and save the changes not remove them?

User avatar
RaTTuS
Posts: 10415
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: Crontab issues on Raspberry Pi 4 with Buster

Tue Jul 16, 2019 3:06 pm

esc:wq

means write and quit

qa:!

means quit all : ignore changes
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

Vaakkux
Posts: 12
Joined: Tue Sep 11, 2018 11:25 am
Location: UK

Re: Crontab issues on Raspberry Pi 4 with Buster

Tue Jul 16, 2019 3:50 pm

RaTTuS wrote:
Tue Jul 16, 2019 3:06 pm
esc:wq

means write and quit

qa:!

means quit all : ignore changes
It's worked, thank you for your help.

User avatar
DougieLawson
Posts: 35814
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Crontab issues on Raspberry Pi 4 with Buster

Tue Jul 16, 2019 8:36 pm

If you use EDITOR=nano crontab -e it will switch to nano. There's also select-editor which allows you to choose your preferred EDITOR variable setting.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Return to “Troubleshooting”